Skip to content
1 min read · 75 words

Variable: mistralToolCallParser

ts
const mistralToolCallParser: ToolCallParserFn;

Defined in: src/batteries/llm/chat_common/tool_parsers.ts:924

Parse Mistral tool calls — the [TOOL_CALLS] token followed by a JSON array of { name, arguments }. Anchored on the literal [TOOL_CALLS] token.

Remarks

The array is located by a string-aware balanced-bracket scan from the first [ after the token (same approach as phiToolCallParser), so a ] inside a string argument value (e.g. {"text":"a]b"}) does not truncate the array the way the old greedy \[[\s\S]*\] regex did.