Decodes one tool call fragment.
Instruction to decode.
The decoded fragment, or null when the instruction is not a tool delta.
null
ToolCallError when the payload is present but malformed.
for (const instruction of chunk.code) { const call = delta.decodeToolCall(instruction); if (call?.name) console.log(call.name);} Copy
for (const instruction of chunk.code) { const call = delta.decodeToolCall(instruction); if (call?.name) console.log(call.name);}
Decodes one tool call fragment.