Struttura dell'oggetto Azure OpenAI
L'integrazione di Azure OpenAI Service con la tua applicazione ti consente di utilizzare senza problemi molteplici distribuzioni e modelli regionali ospitati da Azure OpenAI. Questa sezione descrive in dettaglio come configurare l'endpoint Azure OpenAI per le tue esigenze.
Per una guida dettagliata sulla configurazione di Azure OpenAI, clicca qui
Esempio di configurazione
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: trueNota: L'endpoint Azure OpenAI supporta tutte le Shared Endpoint Settings, inclusi
streamRate,titleModel,titleMethod,titlePrompt,titlePromptTemplateetitleEndpoint.
assistants
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| assistants | Boolean | Abilita o disabilita gli assistenti per l'endpoint Azure OpenAI. Quando impostato su `true`, attiva gli assistenti associati a questo endpoint. | Choose one, either the official OpenAI API or Azure OpenAI API for assistants, not both. |
Predefinito: Non specificato
Esempio:
assistants: truegroups
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| groups | Array | Configurazione per gruppi di modelli in base alla posizione geografica o allo scopo. Ogni elemento nell'array `groups` configura un insieme di modelli sotto un determinato raggruppamento, spesso in base alla regione geografica o a una configurazione distinta. |
Predefinito: Non specificato
Nota: Vedi l'esempio sopra.
Struttura dell'oggetto Group
Ogni elemento sotto groups fa parte di un elenco di record, ognuno con i seguenti campi:
group
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| group | String | Identificatore per un gruppo di modelli. |
Obbligatorio: sì
Esempio:
"group": "my-westus"apiKey
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| apiKey | String | La chiave API per accedere al servizio Azure OpenAI. | It's highly recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
Obbligatorio: sì
Esempio:
apiKey: "${WESTUS_API_KEY}"instanceName
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| instanceName | String | Nome dell'istanza Azure. **Supporta entrambi i formati di dominio**: `.openai.azure.com` (legacy) e `.cognitiveservices.azure.com` (nuovo). È possibile specificare il dominio completo (es. `my-instance.cognitiveservices.azure.com`) o solo il nome dell'istanza (es. `my-instance`) per la compatibilità con le versioni precedenti con il formato legacy `.openai.azure.com`. | It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
Obbligatorio: sì
Esempio:
# 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
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| version | String | Versione API. | It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
Predefinito: Non specificato
Esempio:
version: "2023-12-01-preview"baseURL
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| baseURL | String | L'URL di base per il servizio Azure OpenAI. | It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}` |
Predefinito: Non specificato
Esempio:
baseURL: "https://prod.example.com"additionalHeaders
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| additionalHeaders | Dictionary | Intestazioni aggiuntive per le richieste API. Tutti i valori delle intestazioni devono essere stringhe. | 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. |
Predefinito: Non specificato
Esempio:
additionalHeaders:
X-Custom-Header: ${YOUR_SECRET_CUSTOM_VARIABLE}serverless
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| serverless | Boolean | Indica l'utilizzo di un endpoint di inferenza serverless per le chat completion di Azure OpenAI. Quando impostato su `true`, specifica che il gruppo è configurato per utilizzare endpoint di inferenza serverless come modello "Models as a Service" di Azure. | More info [here](../ai_endpoints/azure.mdx#serverless-inference-endpoints) |
Predefinito: Non specificato
Esempio:
serverless: trueaddParams
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| addParams | Object/Dictionary | Aggiunge parametri aggiuntivi alle richieste. Utile per specificare opzioni specifiche dell'API. |
Predefinito: Non specificato
Esempio:
addParams:
safe_prompt: truedropParams
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| dropParams | Array/List of Strings | Rimuove i parametri predefiniti dalle richieste. Esclude i parametri predefiniti specificati. | Default parameters are the standard request parameters LibreChat sends to the Azure OpenAI API. |
Predefinito: Non specificato
Esempio:
dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]models
Chiave:
| Key | Type | Description | Example |
|---|---|---|---|
| models | Configurazione per singoli modelli all'interno di un gruppo. Configura le impostazioni per ciascun modello, inclusi nome della distribuzione e versione. | 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. |
Predefinito: Non specificato
Esempio:
models:
gpt-4-vision-preview:
deploymentName: "arbitrary-deployment-name"
version: "2024-02-15-preview"Com’è questa guida?