Skip to content

Commit 65b591d

Browse files
Add support for chat_completion task in Azure OpenAI integration
1 parent f2ed2f8 commit 65b591d

File tree

14 files changed

+266
-112
lines changed

14 files changed

+266
-112
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 30 additions & 6 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: 30 additions & 6 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: 120 additions & 91 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": ["completion", "chat_completion", "text_embedding"]
2323
},
2424
"azureopenai_inference_id": {
2525
"type": "string",

specification/inference/_types/CommonTypes.ts

Lines changed: 2 additions & 1 deletion
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
@@ -824,6 +824,7 @@ export class AzureOpenAITaskSettings {
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
@@ -413,7 +413,7 @@ export class RateLimitSetting {
413413
* * `anthropic` service: `50`
414414
* * `azureaistudio` service: `240`
415415
* * `azureopenai` service and task type `text_embedding`: `1440`
416-
* * `azureopenai` service and task type `completion`: `120`
416+
* * `azureopenai` service and task types `completion` or `chat_completion`: `120`
417417
* * `cohere` service: `10000`
418418
* * `contextualai` service: `1000`
419419
* * `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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import { TaskType } from '@inference/_types/TaskType'
3636
* * Amazon Bedrock (`completion`, `text_embedding`)
3737
* * Amazon SageMaker (`chat_completion`, `completion`, `rerank`, `sparse_embedding`, `text_embedding`)
3838
* * Anthropic (`completion`)
39-
* * Azure AI Studio (`completion`, 'rerank', `text_embedding`)
40-
* * Azure OpenAI (`completion`, `text_embedding`)
39+
* * Azure AI Studio (`completion`, `rerank`, `text_embedding`)
40+
* * Azure OpenAI (`completion`, `chat_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
@@ -74,7 +74,7 @@ export interface Request extends RequestBase {
7474
/**
7575
* The chunking configuration object.
7676
* Applies only to the `text_embedding` task type.
77-
* Not applicable to the `completion` task type.
77+
* Not applicable to the `completion` and `chat_completion` task types.
7878
* @ext_doc_id inference-chunking
7979
*/
8080
chunking_settings?: InferenceChunkingSettings

0 commit comments

Comments
 (0)