interceptAgentCompleted

fun interceptAgentCompleted(feature: AIAgentFeature<*, *>, handle: suspend (eventContext: AgentCompletedContext) -> Unit)(source)

Intercepts the completion of an agent's operation and assigns a custom handler to process the result.

Parameters

handle

A suspend function providing custom logic to execute when the agent completes,

Example:

pipeline.interceptAgentCompleted(feature) { eventContext ->
// Handle the completion result here, using the strategy name and the result.
}