onToolCallFailure

fun onToolCallFailure(handler: suspend (eventContext: ToolCallFailureContext) -> Unit)(source)

Append handler called when a tool call fails with an exception.


var onToolCallFailure: suspend (tool: Tool<*, *>, toolArgs: ToolArgs, throwable: Throwable) -> Unit(source)

Deprecated

Please use onToolCallFailure() instead

Replace with

onToolCallFailure(handler)

Defines a handler invoked when a tool call fails due to an exception.

This property is deprecated and will be removed in future versions. Use the onToolCallFailure(handler: suspend (tool: Tool<*, *>, toolArgs: Tool.Args, throwable: Throwable) -> Unit) function instead to add handlers for tool call failure events.

Replacing this property with the newer onToolCallFailure function ensures better consistency and management of handlers.