interceptLLMStreamingStarting
fun interceptLLMStreamingStarting(feature: AIAgentFeature<*, *>, handle: suspend (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
feature
The feature associated with this handler.
handle
The handler that processes before-stream events
Example:
pipeline.interceptLLMStreamingStarting(feature) { eventContext ->
logger.info("About to start streaming with prompt: ${eventContext.prompt.messages.last().content}")
}
Content copied to clipboard