interceptToolCallResult

fun <TFeature : Any> interceptToolCallResult(feature: AIAgentFeature<*, TFeature>, featureImpl: TFeature, handle: suspend TFeature.(tool: Tool<*, *>, toolArgs: Tool.Args, result: ToolResult?) -> Unit)(source)

Intercepts the result of a tool call with a custom handler for a specific feature.

Parameters

handle

A suspending function that defines the behavior to execute when a tool call result is intercepted. The function takes as parameters the stage of the tool call, the tool being called, its arguments, and the result of the tool call if available.

Example:

pipeline.interceptToolCallResult(MyFeature, myFeatureImpl) { tool, toolArgs, result ->
// Handle the tool call result here
}