Migrate AzureOpenAI constructors to OpenAI client
まだ誰も着手していません。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Python
- スター
- 505
- フォーク
- 1.1k
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure-Samples/rag-postgres-openai-python のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Azure-Samples/rag-postgres-openai-python#288 · コメント 1 件 ·
-
Azure-Samples/rag-postgres-openai-python#273 · 担当者 1 名 ·
-
Azure-Samples/rag-postgres-openai-python#261 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Question: Why are you installing `postgres-client` and `xdg-utils` in the backend docker image? オープン
Azure-Samples/rag-postgres-openai-python#250 · コメント 4 件 · リアクション 1 件 · 担当者 1 名 ·
Azure-Samples/rag-postgres-openai-python の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·