interceptLLMCallStarting
fun <TFeature : Any> interceptLLMCallStarting(interceptContext: InterceptContext<TFeature>, handle: suspend TFeature.(eventContext: LLMCallStartingContext) -> Unit)(source)
Intercepts LLM calls before they are made to modify or log the prompt.
Parameters
handle
The handler that processes before-LLM-call events
Example:
pipeline.interceptLLMCallStarting(interceptContext) { eventContext ->
logger.info("About to make LLM call with prompt: ${eventContext.prompt.messages.last().content}")
}
Content copied to clipboard