Skip to content

Commit 5b295b2

Browse files
Add support for chat_completion task in Azure OpenAI integration (#5796)
1 parent 5483ed3 commit 5b295b2

File tree

14 files changed

+273
-119
lines changed

14 files changed

+273
-119
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 125 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_json_spec/inference.put_azureopenai.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"task_type": {
2020
"type": "enum",
2121
"description": "The task type",
22-
"options": ["completion", "text_embedding"]
22+
"options": ["chat_completion", "completion", "text_embedding"]
2323
},
2424
"azureopenai_inference_id": {
2525
"type": "string",

specification/inference/_types/CommonTypes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ export class AzureOpenAIServiceSettings {
802802
* This setting helps to minimize the number of rate limit errors returned from Azure.
803803
* The `azureopenai` service sets a default number of requests allowed per minute depending on the task type.
804804
* For `text_embedding`, it is set to `1440`.
805-
* For `completion`, it is set to `120`.
805+
* For `completion` and `chat_completion`, it is set to `120`.
806806
* @ext_doc_id azureopenai-quota-limits
807807
*/
808808
rate_limit?: RateLimitSetting
@@ -816,14 +816,15 @@ export class AzureOpenAIServiceSettings {
816816

817817
export class AzureOpenAITaskSettings {
818818
/**
819-
* For a `completion` or `text_embedding` task, specify the user issuing the request.
819+
* For a `completion`, `chat_completion` or `text_embedding` task, specify the user issuing the request.
820820
* This information can be used for abuse detection.
821821
*/
822822
user?: string
823823
}
824824

825825
export enum AzureOpenAITaskType {
826826
completion,
827+
chat_completion,
827828
text_embedding
828829
}
829830

specification/inference/_types/Services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export class RateLimitSetting {
425425
* * `anthropic` service: `50`
426426
* * `azureaistudio` service: `240`
427427
* * `azureopenai` service and task type `text_embedding`: `1440`
428-
* * `azureopenai` service and task type `completion`: `120`
428+
* * `azureopenai` service and task types `completion` or `chat_completion`: `120`
429429
* * `cohere` service: `10000`
430430
* * `contextualai` service: `1000`
431431
* * `elastic` service and task type `chat_completion`: `240`

specification/inference/_types/TaskType.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export enum TaskTypeAzureAIStudio {
7070

7171
export enum TaskTypeAzureOpenAI {
7272
text_embedding,
73-
completion
73+
completion,
74+
chat_completion
7475
}
7576

7677
export enum TaskTypeCohere {

specification/inference/put/PutRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { TaskType } from '@inference/_types/TaskType'
3737
* * Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)
3838
* * Anthropic (`completion`)
3939
* * Azure AI Studio (`completion`, `rerank`, `text_embedding`)
40-
* * Azure OpenAI (`completion`, `text_embedding`)
40+
* * Azure OpenAI (`chat_completion`, `completion`, `text_embedding`)
4141
* * Cohere (`completion`, `rerank`, `text_embedding`)
4242
* * DeepSeek (`chat_completion`, `completion`)
4343
* * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland)

specification/inference/put_azureopenai/PutAzureOpenAiRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export interface Request extends RequestBase {
7676
/**
7777
* The chunking configuration object.
7878
* Applies only to the `text_embedding` task type.
79-
* Not applicable to the `completion` task type.
79+
* Not applicable to the `completion` and `chat_completion` task types.
8080
* @ext_doc_id inference-chunking
8181
*/
8282
chunking_settings?: InferenceChunkingSettings

0 commit comments

Comments
 (0)