Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Migrate AzureOpenAI constructors to OpenAI client

オープン
#269 コメント 0 件 リアクション 1 件 担当者 1 名 GitHub で見る

まだ誰も着手していません。

評価

この 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

  1. 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,
    )
    
    • AzureOpenAIOpenAI (or AsyncAzureOpenAIAsyncOpenAI).
    • azure_endpointbase_url.
    • azure_ad_token_provider (or similar Azure credential helpers) → api_key.
  2. Remove api_version usage

    • Delete the api_version=... argument from client construction.
    • Remove any AZURE_OPENAI_VERSION environment variables and references (including
      .env, application settings, and infra/main.bicep or other Bicep files).
  3. Update package requirements

    • Ensure requirements.txt or pyproject.toml declares openai>=1.108.1.
      This is the first version where OpenAI / AsyncOpenAI fully replace the
      Azure-specific constructors.

Follow-up Checklist

  • All Python client instantiations use OpenAI / AsyncOpenAI.
  • No api_version argument 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure-Samples/rag-postgres-openai-python のほかの issue

Azure-Samples/rag-postgres-openai-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。