interceptToolValidationError

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

Intercepts validation errors encountered during the execution of tools associated with the specified feature.

Parameters

handle

A suspendable lambda function that will be invoked when a tool validation error occurs. The lambda provides the tool's stage, tool instance, tool arguments, and the value that caused the validation error.

Example:

pipeline.interceptToolValidationError(MyFeature, myFeatureImpl) { tool, toolArgs, value ->
// Handle the tool validation error here
}