Skip to content
1 min read · 76 words

Variable: gptOssToolCallParser

ts
const gptOssToolCallParser: ToolCallParserFn;

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

Parse gpt-oss Harmony tool calls on the commentary channel: <|channel|>commentary to=functions.NAME <|constrain|>json<|message|>{…}<|call|>. The arguments payload after <|message|> is JSON, located by a string-aware balanced-brace scan so an embedded <|call|> / brace inside a string value survives. Anchored on the literal Harmony markers.

Remarks

The Harmony channel/constrain ordering has a documented upstream template-vs-spec drift; this matches the common ordering. Verify against a real gpt-oss ONNX run when one is available.