Skip to content

Improve tool call success rate: Allow arbitrary tool call parameter ordering for up to 8 params#13

Open
florianbrede-ayet wants to merge 1 commit intopwilkin:autoparserfrom
florianbrede-ayet:autoparser
Open

Improve tool call success rate: Allow arbitrary tool call parameter ordering for up to 8 params#13
florianbrede-ayet wants to merge 1 commit intopwilkin:autoparserfrom
florianbrede-ayet:autoparser

Conversation

@florianbrede-ayet
Copy link

Thanks @pwilkin for working on this branch, it's a nice improvement over the fixed (and often partially broken) chat templates.

However, I noticed tool call failures especially under mistral-vibe which I could reliably reproduce (read_file with offset and limit).

This seems to happen for any qwen35 model, including 27b dense (albeit with a higher chance of correct order).

I debugged your autoparser with claude and found that tool calls enforce a strict parameter order.

Qwen with his native XML tool calls has a very high chance to generate the parameter entities in a very particular order (also tested at different temperatures and penalties - with different seeds you can have a random chance of tool calls succeeding) which does not neccessarily match the expected order in the autoparser.

To limit the number of permutations, I set the "allow any order" to a hard cap of 8 parameters (fallback to sequential order otherwise).

Disclosure: Code was mostly written by Opus, I ran the tests and built it against ROCm and tested it with several hundred tool calls. I don't have a CI/CD setup locally.


Make sure to read the contributing guidelines before submitting a PR

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.

1 participant