Skip to content

Pass tools schema to ToolCallProcessor for type-aware parsing#167

Open
alankessler wants to merge 1 commit intoml-explore:mainfrom
alankessler:fix-tool-call-array-params
Open

Pass tools schema to ToolCallProcessor for type-aware parsing#167
alankessler wants to merge 1 commit intoml-explore:mainfrom
alankessler:fix-tool-call-array-params

Conversation

@alankessler
Copy link
Copy Markdown
Contributor

Fixes #159.

The tools schema was getting to the chat template fine (so the model knew what to call), but it never reached the ToolCallProcessor that parses the response. Without it, the XML parser for Qwen 3.5 couldn't tell that ["a","b"] was an array vs a string, so non-string parameter types came back as raw strings.

Threads tools through generateTaskTextToolTokenLoopHandlerToolCallProcessor. All default to nil so existing callers are unaffected.

The tools schema was passed to the chat template (so the model knew
about the tools) but never forwarded to the ToolCallProcessor that
parses the response. Without it, array and other non-string parameter
types in XML tool call formats (Qwen 3.5) were returned as raw strings
instead of being decoded to their proper types.

Fixes ml-explore#159.
@alankessler alankessler force-pushed the fix-tool-call-array-params branch from 94599af to 42a5390 Compare March 28, 2026 00:49
viktike added a commit to viktike/swama that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Array parameters in tool calls are decoded as strings instead of arrays with Qwen 3.5

1 participant