- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5k
Description
Issue Description
This repository is using the Azure-specific client constructors from the OpenAI SDK:
AzureOpenAI or AsyncAzureOpenAI.
These constructors are deprecated in the latest SDKs. Migrate to the standard
OpenAI / AsyncOpenAI constructors instead so the code stays compatible with the
current API surface.
Required Updates
- 
Replace constructors # Before client = openai.AzureOpenAI( api_version=os.environ["AZURE_OPENAI_VERSION"], azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"], azure_ad_token_provider=token_provider, ) # After client = openai.OpenAI( base_url=os.environ["AZURE_OPENAI_ENDPOINT"], api_key=token_provider, ) - AzureOpenAI→- OpenAI(or- AsyncAzureOpenAI→- AsyncOpenAI).
- azure_endpoint→- base_url.
- azure_ad_token_provider(or similar Azure credential helpers) →- api_key.
 
- 
Remove api_versionusage- Delete the api_version=...argument from client construction.
- Remove any AZURE_OPENAI_VERSIONenvironment variables and references (including
 .env, application settings, andinfra/main.bicepor other Bicep files).
 
- Delete the 
- 
Update package requirements - Ensure requirements.txtorpyproject.tomldeclaresopenai>=1.108.1.
 This is the first version whereOpenAI/AsyncOpenAIfully replace the
 Azure-specific constructors.
 
- Ensure 
Follow-up Checklist
-  All Python client instantiations use OpenAI/AsyncOpenAI.
-  No api_versionargument or related environment variables remain.
-  Dependency metadata requires openai>=1.108.1.
Addressing these items will keep the repository aligned with the supported OpenAI SDK usage.
Details
Pattern: \b(?:AzureOpenAI|AsyncAzureOpenAI)\s*\(
Found matches in 2 file(s) with 3 total match(es):
File: app/backend/prepdocs.py
- 
Line 231: openai_client = AsyncAzureOpenAI(
- 
Line 237: openai_client = AsyncAzureOpenAI(
File: app/backend/prepdocslib/embeddings.py
- Line 199: return AsyncAzureOpenAI(
Repository: https://github.com/Azure-Samples/azure-search-openai-demo
This issue was automatically created by the GitHub Repo Maintainer Agent.