Make api_version Optional with Default to Latest Inference Version (#1913)#2029
Make api_version Optional with Default to Latest Inference Version (#1913)#2029prdai wants to merge 3 commits into
Conversation
…StrategyObject Updated the type alias for FileChunkingStrategyParam to replace StaticFileChunkingStrategyParam with StaticFileChunkingStrategyObject to align with the correct API structure and resolve type errors.
- Updated the constructor of the `AzureOpenAI` class to make the `api_version` argument optional. - If the `api_version` is not provided, it defaults to `"2024-12-01-preview"`, which is the latest inference version. - This change provides flexibility to the user, allowing them to either specify the API version or rely on the default latest version. - The default value (`"2024-12-01-preview"`) is now the fallback if no version is passed. This update improves the user experience by ensuring compatibility with the most recent API version without requiring explicit input from the user.
|
cc @kristapratico, should there be a default version? (I would lean towards keeping it explicit but I don't have full context) |
Thanks for the tag. @Programmer-RD-AI appreciate your feedback on this! However, I do agree with @RobertCraigie on keeping api_version explicit. We would not want to default the Azure client to a preview API version in a library where the version does not indicate a pre-release (per Azure guidelines). There are GA/stable API versions available, I don't think we want to default to those either since these versions don't release as often, may not include the latest features, and could lead to confusion on what's supported. While I do like the convenience this PR provides, I think it should remain that Azure users pin the features they want (by supplying an API version) so that there are no surprises / API changes when upgrading the library. |
This PR addresses the issue #1913 and updates the
AzureOpenAIclass to make theapi_versionargument optional. If not provided, it defaults to"2024-12-01-preview", the latest inference version. This change simplifies the usage of the class and ensures compatibility with the most up-to-date API version without requiring explicit user input.Key Updates:
api_versionargument is now optional with a default value of"2024-12-01-preview".Considerations:
Literalvalues forapi_versionwill need to be updated periodically to include newer versions as they become available.This change improves flexibility and ensures that users can work seamlessly with the latest available API version without needing to specify it manually.