interceptToolCallFailure

fun <TFeature : Any> interceptToolCallFailure(feature: AIAgentFeature<*, TFeature>, featureImpl: TFeature, handle: suspend TFeature.(tool: Tool<*, *>, toolArgs: Tool.Args, throwable: Throwable) -> Unit)(source)

Sets up an interception mechanism to handle tool call failures for a specific feature.

Parameters

handle

A suspend function that is invoked when a tool call fails. It provides the stage, the tool, the tool arguments, and the throwable that caused the failure.

Example:

pipeline.interceptToolCallFailure(MyFeature, myFeatureImpl) { tool, toolArgs, throwable ->
// Handle the tool call failure here
}