Skip to main content

parse_qwen35_xml_tool_calls

Function parse_qwen35_xml_tool_calls 

Source
pub fn parse_qwen35_xml_tool_calls(text: &str) -> Result<Vec<ToolCall>, Error>
Expand description

Parse Qwen3.5 XML parameter-style tool calls from model output.

ยงFormat

<tool_call>
<function=get_weather>
<parameter=location>NYC</parameter>
<parameter=unit>celsius</parameter>
</function>
</tool_call>

Multiple <tool_call> blocks may appear in a single response. Parameter values can span multiple lines and are whitespace-trimmed. Malformed blocks (missing function name, unparseable parameters) are silently skipped.

Returns an empty Vec (not an error) when no tool calls are found.