executeTool

abstract suspend fun executeTool(toolCall: Content.ToolCall, toolMap: Map<String, KoryTool<*, *>>): String

Executes a tool call by finding the matching tool and running it.

Return

The tool execution result as a string, or an error message if the tool is not found.

Parameters

toolCall

The tool call from the model.

toolMap

A map of tool names to KoryTool instances.