- Notifications
You must be signed in to change notification settings - Fork1k
Addtool_choice
toModelSettings
#825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
iabgcb commentedFeb 3, 2025
pls pls see to it urgently that linting errors are solved. |
yea i dont think those failures are on what i added, i think therye elsewhere :) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
After researching; it seems every single one of the major providers supports tool_choice
can we get this landed? |
silkspace commentedFeb 7, 2025
This is a nice to have, and unblocks core functionality. Which runway will this land on? |
since it's supported by the others will add to the other clients as well |
looks like mostof them already supprt / have it integrated, im not sure how it should look for gemini/cohere, cc@sydney-runkle |
kernelzeroday commentedFeb 9, 2025
+1 request for review, are additional changes needed to get this functionality merged? Thank you! |
confused on what more is needed here ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the contribution - this still needs some more support across other model files. Happy to help get this across the line, but we need impl for all supported models.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thanks@sydney-runkle , will try to get these changes in tommorow; I don't have a cohere , groq, or anthropic sub so unsure how to test those ; I only have access to llama based models and openAI so I might need assist on those; anthropic looks pretty straightforward I can prob get that one in also, and groq is llama so can prob swing that one as well, never touched cohere before though |
@webcoderz, you can look at their API/sdk docs to figure out what values are accepted + supported. Given the demand for this, I'm also happy to pick this up tomorrow and get this into our next release. |
ItzAmirreza commentedApr 3, 2025
tool_choice: required in vLLM just got merged. Looking forward for a fix! Thank you all! |
TensorTemplar commentedApr 3, 2025
Was merged to main in vLLM, no actual release yet - but i'll drop a post here once it finished compiling from source if it now works |
theobjectivedad commentedApr 3, 2025
It doesn't work with reasoning models unfortunately, I add a fix to15627. |
TensorTemplar commentedApr 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Neither XGrammar nor Outlines seem to work out of the box with json subschema on some models, but at least the |
ItzAmirreza commentedApr 5, 2025
Do you also got same issue? json.decoder.JSONDecodeError: Expecting ':' delimiter: line 2 column 39 (char 39) |
I think we should still get this pushed through if possible to standardize how to handle tool_choice , unless there’s some alternative methods@Kludex p.s. thanks for your patience with this :) |
tool_choice
toModelSettings
Kludex commentedApr 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@webcoderz is there something missing here? I read somewhere above that my changes were not correct, is that the case? I still need to add tests, but I'd like to add vllm to our test suite. |
TensorTemplar commentedApr 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Your changes work, issues were with tool call json subschema parsing in outlines and xgrammar with vLLM if one adds mcp servers and Edit: to clarify, the tool_choice="required" works without this PR now - the examples above are still broken in tool parser libs but are unrelated to pydantic-ai or this PR |
that’s a great idea |
So nothing missing? 😅 |
webcoderz commentedApr 15, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Haha sorry,was on a meeting and trying to multitask .. no it ended up working once vLLM merged their PR for tool_choice=“required” a couple weeks ago :) there’s so many comments here and that got lost, theres still a slight problem on their side with parsing nested pydantic models for structured output but I think that’s WIP by@theobjectivedad but if you have some suggestions on how to handle that would be helpful |
just checked this and yea seems fine here, the main issue is in xgrammar vllm side now |
@webcoderz Can you please rebase this on main? |
Sure will work on this today/tommorow, it’s been a while :) |
okigan commentedJun 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
bump, this also blocking usage of AWS Bedrock llama4 models so far I've appliedthis as a workaround, but not clear if it covers all use cases. |
@webcoderz Great, please let me know when it's ready for review again! |
This PR is stale, and will be closed in 3 days if no reply is received. |
building upon :#785
i added the tool_choice to ModelSettings