Class MiniMaxToolCallParser

java.lang.Object
smile.llm.tool.MiniMaxToolCallParser
All Implemented Interfaces:
ToolCallParser

public final class MiniMaxToolCallParser extends Object implements ToolCallParser
Parses MiniMax-M3 tool calls:
]<]minimax[>[<tool_call>
]<]minimax[>[<invoke name="get_weather">]<]minimax[>[<city>Paris]<]minimax[>[</city>]<]minimax[>[</invoke>
]<]minimax[>[</tool_call>

Every tag carries the ]<]minimax[>[ prefix. Parameter values are text; objects are nested elements and arrays are repeated <item> elements. When the tool definitions are known, a value is typed from its JSON schema (integer, number, boolean, array, object, string); without a schema, JSON literals (numbers, booleans, null, objects, arrays) are decoded and everything else stays a string. Truncated output (token limit) is tolerated: open elements are closed at the end of the text.

  • Field Details

  • Constructor Details

    • MiniMaxToolCallParser

      public MiniMaxToolCallParser()
      Parser without tool schemas: values are typed heuristically.
    • MiniMaxToolCallParser

      public MiniMaxToolCallParser(ToolDefinition[] tools)
      Parser that types arguments from the tools' JSON schemas.
      Parameters:
      tools - tool definitions of the request; may be null.
  • Method Details

    • parse

      public ParseResult parse(String assistantText)
      Description copied from interface: ToolCallParser
      Parses a complete assistant response.
      Specified by:
      parse in interface ToolCallParser
      Parameters:
      assistantText - decoded generation text.
      Returns:
      parse result with optional tool calls.