executeSingleTool

expect open suspend override fun <ToolArg, TResult> executeSingleTool(tool: Tool<ToolArg, TResult>, toolArgs: ToolArg, doUpdatePrompt: Boolean): SafeTool.Result<TResult>(source)

Calls a specific tool directly using the provided arguments.

Return

The result of the tool execution.

Parameters

tool

The tool to execute.

toolArgs

The arguments to pass to the tool.

doUpdatePrompt

Specifies whether to add tool call details to the prompt.

fun <ToolArg, ToolResult> executeSingleTool(tool: Tool<ToolArg, ToolResult>, toolArgs: ToolArg, doUpdatePrompt: Boolean, executorService: ERROR CLASS: Symbol not found for ExecutorService?? = null): SafeTool.Result<ToolResult>(source)

Executes a single tool with the specified arguments.

Return

The result of the executed tool wrapped in a SafeTool.Result.

Parameters

tool

The tool to be executed.

toolArgs

The arguments to be passed to the tool.

doUpdatePrompt

A flag indicating whether to update the prompt during execution.

executorService

The executor service to be used for execution. If null, a default dispatcher will be used.