Skip to content

Enable dynamic setting of Azure OpenAI API version#1

Open
pmalarme wants to merge 1 commit intomainfrom
dynamic-api-version
Open

Enable dynamic setting of Azure OpenAI API version#1
pmalarme wants to merge 1 commit intomainfrom
dynamic-api-version

Conversation

@pmalarme
Copy link
Owner

@pmalarme pmalarme commented May 17, 2024

Implements dynamic setting and retrieval of the Azure OpenAI API version in the backend.

  • Introduces two new Flask routes:
    • Adds a GET route /api/version to return the current Azure OpenAI API version.
    • Adds a POST route /api/version to update the Azure OpenAI API version based on the request body. This change allows the API version to be dynamically set and retrieved, enhancing flexibility and control over the API version used.
  • Environment variable handling:
    • Modifies the initialization of openai.api_version to fetch the version from the OPENAI_API_VERSION environment variable, with a default fallback to '2023-03-15-preview' if the environment variable is not set. This ensures that the API version can be configured externally and dynamically.

For more details, open the Copilot Workspace session.

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.

1 participant