Migrate AzureOpenAI constructors to OpenAI client
Mantenedores costumam responder em até 2 dias
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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(orAsyncAzureOpenAI→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 6 total match(es):
File: evals/generate_ground_truth.py
-
Line 88:
openai_client = AzureOpenAI( -
Line 97:
openai_client = AzureOpenAI(
File: src/backend/fastapi_app/openai_clients.py
-
Line 26:
openai_chat_client = openai.AsyncAzureOpenAI( -
Line 41:
openai_chat_client = openai.AsyncAzureOpenAI( -
Line 85:
openai_embed_client = openai.AsyncAzureOpenAI( -
Line 100:
openai_embed_client = openai.AsyncAzureOpenAI(
Repository: https://github.com/Azure-Samples/rag-postgres-openai-python
This issue was automatically created by the GitHub Repo Maintainer Agent.
- Linguagem predominante
- Python
- Estrelas
- 505
- Forks
- 1.1k
- Merge médio
- 1d 18h
- PRs com merge (30d)
- 2
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Azure-Samples/rag-postgres-openai-python
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Azure-Samples/rag-postgres-openai-python#288 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Azure-Samples/rag-postgres-openai-python#273 · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Remove the pipeline: variables section from azure.yamlTalvez já em andamento @copilot-swe-agent assumiu há 393 dias. Aberta
Azure-Samples/rag-postgres-openai-python#261 · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Azure-Samples/rag-postgres-openai-python#259 ·
Mantenedores costumam responder em até 2 dias
-
Question: Why are you installing `postgres-client` and `xdg-utils` in the backend docker image?Talvez já em andamento @copilot-swe-agent assumiu há 416 dias. Aberta
Azure-Samples/rag-postgres-openai-python#250 · 4 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 2 dias
Todas as issues de Azure-Samples/rag-postgres-openai-python
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
topoteretes/cognee#5647 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Sendspin/sendspin-python-cli#291 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
awslabs/visual-asset-management-system#414 ·
Mantenedores costumam responder em até 1 dia
-
bug v1 v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
modelcontextprotocol/python-sdk#3670 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
aicell-lab/bioengine#232 ·
Mantenedores costumam responder em até 1 dia