-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
OpenAI AzureChatOpenAI doesn't support the new structured output capability even though BaseChatOpenAI does #26383
Comments
Is there any plan for this to be fixed? |
Whats the update here? |
How can we get this fixed? I would assume most businesses in Europe do not use the OpenAI API directly, but instead through Azure. Thus, this is a pretty bad limitation that it is not implemented for the Azure version of the API. |
Hello, my group and I are from the University of Toronto, and we are going to take a look and work on this issue, hopefully to have a working PR soon. |
Hi Emily, I really appreciate you volunteering to work on this. However, I believe the issue has been fixed already. I've seen no update about it, but I was checking the code and saw that it was updated. Tested it a couple of days ago and it appears to now be working. It only works for GPT-4o, not GPT-4o-mini, but that is an Azure issue, not a Langchain issue. Even though OpenAI released strict structured output for GPT-4o-mini two months ago, Azure is yet to do the same. |
should be fixed as of #26599 which was released in langchain-openai 0.2.2. @arne-rustad @PvanHengel @mgberg could you check if that fixes? |
@baskaryan I confirm this has worked ( had to bump the api version to 2024-08-01-preview ) |
Checked other resources
Example Code
The following code doesn't work:
Error Message and Stack Trace (if applicable)
The exception received was:
Description
I expected the new Structured Output capability (which is available through Azure) which is implemented on
BaseChatOpenAI
to work usingAzureChatOpenAI
. However, after browsing the code, I saw that the support formode="json_schema"
and thestrict
argument is implemented only forBaseChatOpenAI
;AzureChatOpenAI
overridesBaseChatOpenAI.with_structured_outputs
and does not include support for those arguments.System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: