interceptBeforeLLMCall

fun <TFeature : Any> interceptBeforeLLMCall(interceptContext: InterceptContext<TFeature>, handle: suspend TFeature.(eventContext: BeforeLLMCallContext) -> 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.interceptBeforeLLMCall(InterceptContext) { eventContext ->
logger.info("About to make LLM call with prompt: ${eventContext.prompt.messages.last().content}")
}