Pass tools schema to ToolCallProcessor for type-aware parsing#167
Open
alankessler wants to merge 1 commit intoml-explore:mainfrom
Open
Pass tools schema to ToolCallProcessor for type-aware parsing#167alankessler wants to merge 1 commit intoml-explore:mainfrom
alankessler wants to merge 1 commit intoml-explore:mainfrom
Conversation
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.
94599af to
42a5390
Compare
viktike
added a commit
to viktike/swama
that referenced
this pull request
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
toolsthroughgenerateTask→TextToolTokenLoopHandler→ToolCallProcessor. All default to nil so existing callers are unaffected.