Interface ToolHandler
public interface ToolHandler
Executor backing a Tool. The handler receives the raw JSON
argument string the model produced and returns the JSON result
to send back to the model in a ToolResultPart. Implementations
are responsible for parsing argumentsJson (typically with
JSONParser) and for serializing the result.
Pair with Tool via the four-argument constructor, then call
ToolCall.execute(java.util.List) to dispatch.
-
Method Summary
-
Method Details
-
invoke
Invokes the tool. Throw any exception to propagate it back throughToolCall.execute(List)-- the calling code can decide whether to surface the error to the model as a tool result or to abort the chat.- Throws:
Exception
-