Update Azure OpenAI to the latest GA API version#1001
Merged
Conversation
iamdharmesh
approved these changes
Sep 9, 2025
Member
iamdharmesh
left a comment
There was a problem hiding this comment.
@dkotter Thanks for the fixing this. Code looks good and it tests well. (I skipped testing of key takeaway block as it's not compatible with GPT-3.5 Turbo)
Collaborator
Author
|
@gsarig Let me know if you have time to test this and ensure it fixes the issues you were running into, prior to us merging this in. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
We had a report that if using Azure OpenAI with the Key Takeaways Feature, the response would always fail because we set the
reponse_typeto bejson_schemaand it seems that isn't supported in the API version we were using.This PR fixes that by updating the API version from
2023-05-15to the latest GA release,2024-10-21. This release does support structured outputs but worth noting that only works if using a compatible model.In addition, this PR adds a new helper method to get the API version and wraps the response of that in a new filter,
classifai_azure_openai_api_version, making it easier for others to change the API version that is used (if, for instance, you want to use a preview version).And finally, in testing to ensure this new API version works for all the Features we support, discovered that the Content Generation Feature wasn't working due to an existing bug so that is fixed here as well.
How to test the Change
Azure OpenAI supports the following Language Processing Features:
Configure each of these to use Azure OpenAI and ensure they all still work. Note that for the Key Takeaways Feature, you need to test with a compatible model (not GPT-3.5 Turbo for instance).
Changelog Entry
Credits
Props @gsarig, @dkotter
Checklist: