interceptAgentExecutionFailed

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

Intercepts and handles errors occurring during the execution of an AI agent's strategy.

Parameters

handle

A suspend function providing custom logic to execute when an error occurs,

Example:

pipeline.interceptAgentExecutionFailed(feature) { eventContext ->
// Handle the error here, using the strategy name and the exception that occurred.
}