Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Azure OpenAI オブジェクト構造

Azure OpenAI Serviceをアプリケーションに統合することで、Azure OpenAIでホストされている複数のデプロイメントやリージョンモデルをシームレスに利用できるようになります。このセクションでは、ニーズに合わせてAzure OpenAI endpointを設定する方法を詳しく説明します。

Azure OpenAI設定のセットアップに関する詳細ガイドは、こちらをクリックしてください

設定例

endpoints:
  azureOpenAI:
    titleModel: "gpt-4-turbo"
    groups:
      - group: "my-westus" # arbitrary name
        apiKey: "${WESTUS_API_KEY}"
        instanceName: "actual-instance-name" # name of the resource group or instance
        version: "2023-12-01-preview"
        # baseURL: https://prod.example.com
        # additionalHeaders:
        #   X-Custom-Header: value
        models:
          gpt-4-vision-preview:
            deploymentName: gpt-4-vision-preview
            version: "2024-02-15-preview"
          gpt-3.5-turbo:
            deploymentName: gpt-35-turbo
          gpt-3.5-turbo-1106:
            deploymentName: gpt-35-turbo-1106
          gpt-4:
            deploymentName: gpt-4
          gpt-4-1106-preview:
            deploymentName: gpt-4-1106-preview
      - group: "my-eastus"
        apiKey: "${EASTUS_API_KEY}"
        instanceName: "actual-eastus-instance-name"
        deploymentName: gpt-4-turbo
        version: "2024-02-15-preview"
        baseURL: "https://gateway.ai.cloudflare.com/v1/cloudflareId/azure/azure-openai/${INSTANCE_NAME}/${DEPLOYMENT_NAME}" # uses env variables
        additionalHeaders:
          X-Custom-Header: value
        models:
          gpt-4-turbo: true

注: Azure OpenAI endpoint は、streamRatetitleModeltitleMethodtitlePrompttitlePromptTemplatetitleEndpoint を含む、すべての Shared Endpoint Settings をサポートしています。

assistants

キー:

KeyTypeDescriptionExample
assistantsBooleanAzure OpenAI endpointのassistantsを有効または無効にします。`true`に設定すると、このendpointに関連付けられたassistantsが有効になります。Choose one, either the official OpenAI API or Azure OpenAI API for assistants, not both.

デフォルト: 指定なし

例:

assistants: true

groups

キー:

KeyTypeDescriptionExample
groupsArray地理的場所や目的別のモデルグループの設定。`groups`配列内の各項目は、特定のグループ化(多くの場合、地理的リージョンや個別の設定によるもの)の下でモデルのセットを構成します。

デフォルト: 指定なし

注: 上記の例を参照してください。

Group オブジェクト構造

groups 配下の各項目はレコードのリストの一部であり、それぞれ以下のフィールドを持ちます:

group

キー:

KeyTypeDescriptionExample
groupStringモデルグループの識別子。

必須: はい

例:

"group": "my-westus"

apiKey

キー:

KeyTypeDescriptionExample
apiKeyStringAzure OpenAI ServiceにアクセスするためのAPIキー。It's highly recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

必須: はい

例:

apiKey: "${WESTUS_API_KEY}"

instanceName

キー:

KeyTypeDescriptionExample
instanceNameStringAzureインスタンスの名前。**2つのドメイン形式をサポートしています**:`.openai.azure.com`(レガシー)および `.cognitiveservices.azure.com`(新規)。完全なドメイン(例:`my-instance.cognitiveservices.azure.com`)を指定することも、レガシーな `.openai.azure.com` 形式との後方互換性のためにインスタンス名のみ(例:`my-instance`)を指定することも可能です。It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

必須: はい

例:

# Using just the instance name (legacy format applied)
instanceName: "my-westus"
# OR using the full domain (new format)
instanceName: "my-westus.cognitiveservices.azure.com"

version

キー:

KeyTypeDescriptionExample
versionStringAPIバージョンIt's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

デフォルト: 指定なし

例:

version: "2023-12-01-preview"

baseURL

キー:

KeyTypeDescriptionExample
baseURLStringAzure OpenAI ServiceのベースURL。It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

デフォルト: 指定なし

例:

baseURL: "https://prod.example.com"

additionalHeaders

キー:

KeyTypeDescriptionExample
additionalHeadersDictionaryAPIリクエスト用の追加ヘッダー。すべてのヘッダー値は文字列である必要があります。It's recommended to use a custom env. variable reference for the values of field, as shown in the example. `api-key` header value is sent on every request.

デフォルト: 指定なし

例:

additionalHeaders:
  X-Custom-Header: ${YOUR_SECRET_CUSTOM_VARIABLE}

serverless

キー:

KeyTypeDescriptionExample
serverlessBooleanAzure OpenAIチャット補完にサーバーレス推論エンドポイントを使用することを示します。`true`に設定すると、そのグループがAzureの「Models as a Service」モデルとしてサーバーレス推論エンドポイントを使用するように構成されていることを指定します。More info [here](./azure_openai.md#serverless-inference-endpoints)

デフォルト: 指定なし

例:

serverless: true

addParams

キー:

KeyTypeDescriptionExample
addParamsObject/Dictionaryリクエストに追加のパラメータを追加します。API固有のオプションを指定する際に便利です。

デフォルト: 指定なし

例:

addParams:
  safe_prompt: true

dropParams

キー:

KeyTypeDescriptionExample
dropParamsArray/List of Stringsリクエストから[default parameters](#default-parameters)を削除します。指定された[default parameters](#default-parameters)を除外します。For a list of default parameters sent with every request, see the ["Default Parameters"](#default-parameters) Section below.

デフォルト: 指定なし

例:

dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]

models

キー:

KeyTypeDescriptionExample
modelsグループ内の個々のモデルに対する設定。デプロイ名やバージョンを含む、各モデルの設定を行います。Model configurations can adopt the group's deployment name and/or version when configured as a boolean (set to `true`) or an object for detailed settings of either of those fields.

デフォルト: 指定なし

例:

models:
  gpt-4-vision-preview: 
    deploymentName: "arbitrary-deployment-name"
    version: "2024-02-15-preview"

このガイドはいかがでしたか?