-
Notifications
You must be signed in to change notification settings - Fork 447
[Inference Providers] Fix structured output #1579
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 our terms of service and privacy 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
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.
Looks good to me!
Seems like together and fireworks-ai are now following OpenAI specs for this field (double checked their docs as well).
Does it mean Python SDK broke for those 2 ? 😄
for fireworks-ai, it still works (I mean, they definitely shouldn't break that and not keep it backward compatible 😄) as for Together, I initially thought they were now totally compatible, but it turns out they're still not fully compatible just yet, I pushed bf05b9b to add a mapping. |
(take with a grain of salt as i've been following from afar) They're all likely to change to be fully OpenAI compliant so we could write code that conditionally support the current situation but also works if they move to full compliance, no? |
@julien-c i tried to make things forward compatible, for Nebius, we already are. For together, their API rejects requests that contain both a |
ah yes re-reading i'm a bit dumb i was thinking of supporting evolutions in responses, but in requests there's not really a way to do it. |
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.
looks good - I pushed a few changes to leverage the typing system a bit more, please review them @hanouticelina
I haven't tested the actual inference though
equivalent PR to huggingface/huggingface_hub#3082.
sambanova
andnebius
don’t fully follow OpenAI’s spec for theresponse_format
field. This PR adds internal mappings for each provider. Seems likefireworks-ai
is now following OpenAI specs for this field (double checked their docs as well).