Class JsonToolCallParser
java.lang.Object
smile.llm.tool.JsonToolCallParser
- All Implemented Interfaces:
ToolCallParser
Parses OpenAI-style / OGA JSON tool-call blocks:
<tool_call>
{"name":"get_weather","arguments":{"city":"SF"}}
</tool_call>
Also accepts a bare JSON object or array of name/arguments
(or function.name / function.arguments) when no XML wrapper
is present.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParses a complete assistant response.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ToolCallParser
parse
-
Constructor Details
-
JsonToolCallParser
public JsonToolCallParser()Creates a JSON tool-call parser.
-
-
Method Details
-
parse
Description copied from interface:ToolCallParserParses a complete assistant response.- Specified by:
parsein interfaceToolCallParser- Parameters:
assistantText- decoded generation text.- Returns:
- parse result with optional tool calls.
-