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 は、
streamRate、titleModel、titleMethod、titlePrompt、titlePromptTemplate、titleEndpointを含む、すべての Shared Endpoint Settings をサポートしています。
assistants
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| assistants | Boolean | Azure OpenAI endpointのassistantsを有効または無効にします。`true`に設定すると、このendpointに関連付けられたassistantsが有効になります。 | Choose one, either the official OpenAI API or Azure OpenAI API for assistants, not both. |
デフォルト: 指定なし
例:
assistants: truegroups
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| groups | Array | 地理的な場所や目的別のモデルグループの設定。`groups`配列内の各項目は、特定のグループ化(多くの場合、地理的リージョンや個別の設定によるもの)の下でモデルのセットを構成します。 |
デフォルト: 指定なし
Group オブジェクト構造
groups 配下の各項目はレコードのリストの一部であり、それぞれ以下のフィールドを持ちます:
group
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| group | String | モデルグループの識別子。 |
必須: はい
例:
"group": "my-westus"apiKey
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| apiKey | String | Azure 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
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| instanceName | String | Azureインスタンスの名前。**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
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| version | String | APIバージョン | It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
デフォルト: 指定なし
例:
version: "2023-12-01-preview"baseURL
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| baseURL | String | Azure 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
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| additionalHeaders | Dictionary | APIリクエスト用の追加ヘッダー。すべてのヘッダー値は文字列である必要があります。 | 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
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| serverless | Boolean | Azure OpenAIチャット補完にサーバーレス推論エンドポイントを使用することを示します。`true`に設定すると、そのグループがAzureの「Models as a Service」モデルとしてサーバーレス推論エンドポイントを使用するように構成されていることを指定します。 | More info [here](../ai_endpoints/azure.mdx#serverless-inference-endpoints) |
デフォルト: 指定なし
例:
serverless: trueaddParams
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| addParams | Object/Dictionary | リクエストに追加のパラメータを追加します。API固有のオプションを指定する際に便利です。 |
デフォルト: 指定なし
例:
addParams:
safe_prompt: truedropParams
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| dropParams | Array/List of Strings | リクエストからデフォルトパラメータを削除します。指定されたデフォルトパラメータを除外します。 | Default parameters are the standard request parameters LibreChat sends to the Azure OpenAI API. |
デフォルト: 指定なし
例:
dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]models
キー:
| Key | Type | Description | Example |
|---|---|---|---|
| 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"このガイドはいかがでしたか?