interceptToolCall

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

Intercepts and handles tool calls for the specified feature and its implementation. Updates the tool call handler for the given feature key with a custom handler.

Parameters

handle

A suspend lambda function that processes tool calls, taking the tool, and its arguments as parameters.

Example:

pipeline.interceptToolCall(MyFeature, myFeatureImpl) { tool, toolArgs ->
// Process or log the tool call
}