interceptLLMStreamingStarting

fun <TFeature : Any> interceptLLMStreamingStarting(interceptContext: InterceptContext<TFeature>, handle: suspend TFeature.(eventContext: LLMStreamingStartingContext) -> Unit)(source)

Intercepts streaming operations before they begin to modify or log the streaming request.

This method allows features to hook into the streaming pipeline before streaming starts, enabling preprocessing, validation, or logging of streaming requests.

Parameters

interceptContext

The context containing the feature and its implementation

handle

The handler that processes before-stream events

Example:

pipeline.interceptLLMStreamingStarting(interceptContext) { eventContext ->
logger.info("About to start streaming with prompt: ${eventContext.prompt.messages.last().content}")
}