Open mgberg opened 1 month ago
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.
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?
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