Skip to content

Make api_version Optional with Default to Latest Inference Version (#1913)#2029

Closed
prdai wants to merge 3 commits into
openai:mainfrom
prdai-archive:feat/#1913
Closed

Make api_version Optional with Default to Latest Inference Version (#1913)#2029
prdai wants to merge 3 commits into
openai:mainfrom
prdai-archive:feat/#1913

Conversation

@prdai
Copy link
Copy Markdown

@prdai prdai commented Jan 18, 2025

This PR addresses the issue #1913 and updates the AzureOpenAI class to make the api_version argument 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:

  • The api_version argument is now optional with a default value of "2024-12-01-preview".
  • The default API version ensures that users are automatically aligned with the latest version of the service.

Considerations:

  • The Literal values for api_version will need to be updated periodically to include newer versions as they become available.
  • The current list of versions was sourced from Microsoft’s API version deprecation documentation.
  • We should monitor and update this list regularly to keep it aligned with the latest available API versions.

This change improves flexibility and ensures that users can work seamlessly with the latest available API version without needing to specify it manually.

prdai added 3 commits January 14, 2025 10:01
…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.
@prdai prdai requested a review from a team as a code owner January 18, 2025 04:49
@prdai prdai changed the title Make api_version Optional with Default to Latest Inference Version Make api_version Optional with Default to Latest Inference Version (#1913) Jan 18, 2025
@RobertCraigie
Copy link
Copy Markdown
Collaborator

cc @kristapratico, should there be a default version? (I would lean towards keeping it explicit but I don't have full context)

@kristapratico
Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants