Azure OpenAI 对象结构
将 Azure OpenAI Service 集成到您的应用程序中,使您能够无缝利用 Azure OpenAI 托管的多个部署和区域模型。本节详细介绍了如何根据您的需求配置 Azure OpenAI endpoint。
有关设置 Azure OpenAI 配置的详细指南,请点击此处
示例配置
注意: Azure OpenAI endpoint 支持所有 Shared Endpoint Settings,包括
streamRate、titleModel、titleMethod、titlePrompt、titlePromptTemplate和titleEndpoint。
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. |
默认值: 未指定
示例:
groups
键:
| Key | Type | Description | Example |
|---|---|---|---|
| groups | Array | 按地理位置或用途对模型组进行的配置。`groups` 数组中的每一项都配置了一组特定分组下的模型,通常按地理区域或不同的配置进行划分。 |
默认值: 未指定
注意: 请参阅上方的示例。
组对象结构
groups 下的每一项都是记录列表的一部分,每一项都包含以下字段:
group
键:
| Key | Type | Description | Example |
|---|---|---|---|
| group | String | 模型组的标识符。 |
必需: 是
示例:
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}` |
必需: 是
示例:
instanceName
键:
| Key | Type | Description | Example |
|---|---|---|---|
| instanceName | String | Azure 实例的名称。**支持两种域名格式**:`.openai.azure.com`(旧版)和 `.cognitiveservices.azure.com`(新版)。您可以指定完整域名(例如 `my-instance.cognitiveservices.azure.com`),也可以仅指定实例名称(例如 `my-instance`),以保持与旧版 `.openai.azure.com` 格式的向后兼容性。 | It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
必需: 是
示例:
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}` |
默认值: 未指定
示例:
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}` |
默认值: 未指定
示例:
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. |
默认值: 未指定
示例:
serverless
键:
| Key | Type | Description | Example |
|---|---|---|---|
| serverless | Boolean | 指示使用用于 Azure OpenAI 聊天补全的无服务器推理 endpoint。当设置为 `true` 时,指定该组被配置为使用无服务器推理 endpoint 作为 Azure “模型即服务”(Models as a Service) 模型。 | More info [here](./azure_openai.md#serverless-inference-endpoints) |
默认值: 未指定
示例:
addParams
键:
| Key | Type | Description | Example |
|---|---|---|---|
| addParams | Object/Dictionary | 向请求添加额外参数。适用于指定特定于 API 的选项。 |
默认值: 未指定
示例:
dropParams
键:
| Key | Type | Description | Example |
|---|---|---|---|
| dropParams | Array/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. |
默认值: 未指定
示例:
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. |
默认值: 未指定
示例:
这篇指南怎么样?