interceptAgentRunError

fun <TFeature : Any> interceptAgentRunError(feature: AIAgentFeature<*, TFeature>, featureImpl: TFeature, handle: suspend TFeature.(strategyName: String, throwable: Throwable) -> 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.interceptAgentRunError(MyFeature, myFeatureImpl) { strategyName, throwable ->
// Handle the error here, using the strategy name and the exception that occurred.
}