From cef2af0bc982fa082d0d33fa0f2f1a746dc06e88 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Wed, 1 Oct 2025 11:55:55 +0100 Subject: [PATCH 1/2] Contextual AI docs --- specification/inference/_types/CommonTypes.ts | 49 +++++++++++ specification/inference/_types/Services.ts | 13 +++ specification/inference/_types/TaskType.ts | 4 + .../PutContextualAiRequest.ts | 87 +++++++++++++++++++ .../PutContextualAiResponse.ts | 25 ++++++ .../PutContextualAiRequestExample1.yaml | 16 ++++ 6 files changed, 194 insertions(+) create mode 100644 specification/inference/put_contextualai/PutContextualAiRequest.ts create mode 100644 specification/inference/put_contextualai/PutContextualAiResponse.ts create mode 100644 specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 07d5d374c8..a08e978698 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -1195,6 +1195,55 @@ export class CustomTaskSettings { parameters?: UserDefinedValue } +export enum ContextualAIServiceType { + contextualai +} + +export class ContextualAIServiceSettings { + /** + * A valid API key for your Contexutual AI account. + * + * IMPORTANT: You need to provide the API key only once, during the inference model creation. + * The get inference endpoint API does not retrieve your API key. + * After creating the inference model, you cannot change the associated API key. + * If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. + * @ext_doc_id contextualai-api-keys + */ + api_key: string + /** + * The name of the model to use for the inference task. + * Refer to the Contextual AI documentation for the list of available rerank models. + * @ext_doc_id contextualai-rerank + */ + model_id: string + /** + * This setting helps to minimize the number of rate limit errors returned from Contextual AI. + * The `contextualai` service sets a default number of requests allowed per minute depending on the task type. + * For `rerank`, it is set to `1000`. + */ + rate_limit?: RateLimitSetting +} + +export class ContextualAITaskSettings { + /** + * Instructions for the reranking model. Refer to + * Only for the `rerank` task type. + */ + instruction?: string + /** + * Whether to return the source documents in the response. + * Only for the `rerank` task type. + * @server_default false + */ + return_documents?: boolean + /** + * The number of most relevant documents to return. + * If not specified, the reranking results of all documents will be returned. + * Only for the `rerank` task type. + */ + top_k?: integer +} + export class DeepSeekServiceSettings { /** * A valid API key for your DeepSeek account. diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index 1af04c1928..2fa4950441 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -29,6 +29,7 @@ import { TaskTypeAzureAIStudio, TaskTypeAzureOpenAI, TaskTypeCohere, + TaskTypeContextualAI, TaskTypeCustom, TaskTypeDeepSeek, TaskTypeElasticsearch, @@ -168,6 +169,17 @@ export class InferenceEndpointInfoCohere extends InferenceEndpoint { task_type: TaskTypeCohere } +export class InferenceEndpointInfoContextualAi extends InferenceEndpoint { + /** + * The inference Id + */ + inference_id: string + /** + * The task type + */ + task_type: TaskTypeContextualAI +} + export class InferenceEndpointInfoCustom extends InferenceEndpoint { /** * The inference Id @@ -389,6 +401,7 @@ export class RateLimitSetting { * * `azureopenai` service and task type `text_embedding`: `1440` * * `azureopenai` service and task type `completion`: `120` * * `cohere` service: `10000` + * * `contextualai` service: `1000` * * `elastic` service and task type `chat_completion`: `240` * * `googleaistudio` service: `360` * * `googlevertexai` service: `30000` diff --git a/specification/inference/_types/TaskType.ts b/specification/inference/_types/TaskType.ts index 5e76973a74..e0e5882eb3 100644 --- a/specification/inference/_types/TaskType.ts +++ b/specification/inference/_types/TaskType.ts @@ -79,6 +79,10 @@ export enum TaskTypeCohere { completion } +export enum TaskTypeContextualAI { + rerank +} + export enum TaskTypeCustom { text_embedding, sparse_embedding, diff --git a/specification/inference/put_contextualai/PutContextualAiRequest.ts b/specification/inference/put_contextualai/PutContextualAiRequest.ts new file mode 100644 index 0000000000..07619f4578 --- /dev/null +++ b/specification/inference/put_contextualai/PutContextualAiRequest.ts @@ -0,0 +1,87 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' +import { Duration } from '@_types/Time' +import { TaskTypeContextualAI } from '@inference/_types/TaskType' +import { + ContextualAIServiceSettings, + ContextualAIServiceType, + ContextualAITaskSettings, +} from '@inference/_types/CommonTypes' +import { InferenceChunkingSettings } from '@inference/_types/Services' + +/** + * Create an Contextual AI inference endpoint. + * + * Create an inference endpoint to perform an inference task with the `contexualai` service. + * + * To review the available `rerank` models, refer to . + * @rest_spec_name inference.put_contextualai + * @availability stack since=9.2.0 stability=stable visibility=public + * @availability serverless stability=stable visibility=public + * @cluster_privileges manage_inference + * @doc_id inference-api-put-contextualai + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_inference/{task_type}/{contextualai_inference_id}' + methods: ['PUT'] + } + ] + path_parts: { + /** + * The type of the inference task that the model will perform. + */ + task_type: TaskTypeContextualAI + /** + * The unique identifier of the inference endpoint. + */ + contextualai_inference_id: Id + } + query_parameters: { + /** + * Specifies the amount of time to wait for the inference endpoint to be created. + * @server_default 30s + */ + timeout?: Duration + } + body: { + /** + * The chunking configuration object. + * @ext_doc_id inference-chunking + */ + chunking_settings?: InferenceChunkingSettings + /** + * The type of service supported for the specified task type. In this case, `contextualai`. + */ + service: ContextualAIServiceType + /** + * Settings used to install the inference model. These settings are specific to the `contextualai` service. + */ + service_settings: ContextualAIServiceSettings + /** + * Settings to configure the inference task. + * These settings are specific to the task type you specified. + */ + task_settings?: ContextualAITaskSettings + } +} diff --git a/specification/inference/put_contextualai/PutContextualAiResponse.ts b/specification/inference/put_contextualai/PutContextualAiResponse.ts new file mode 100644 index 0000000000..b816091333 --- /dev/null +++ b/specification/inference/put_contextualai/PutContextualAiResponse.ts @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { InferenceEndpointInfoContextualAi } from '@inference/_types/Services' + +export class Response { + /** @codegen_name endpoint_info */ + body: InferenceEndpointInfoContextualAi +} diff --git a/specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml b/specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml new file mode 100644 index 0000000000..28c8825ea2 --- /dev/null +++ b/specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml @@ -0,0 +1,16 @@ +summary: A rerank task +description: Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service. +method_request: 'PUT _inference/rerank/contextualai-rerank' +# type: "request" +value: |- + { + "service": "contextualai", + "service_settings": { + "api_key": "ContextualAI-Api-key", + "model_id": "ctxl-rerank-v2-instruct-multilingual-mini" + }, + "task_settings": { + "instruction": "Rerank the following documents based on their relevance to the query.", + "top_k": 3 + } + } From 2485d0758317ead0bb9017e29c05631a2517511f Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 2 Oct 2025 13:04:24 +0400 Subject: [PATCH 2/2] Fix CI --- output/openapi/elasticsearch-openapi.json | 205 ++++++- .../elasticsearch-serverless-openapi.json | 205 ++++++- output/schema/schema.json | 517 +++++++++++++++--- output/typescript/types.ts | 35 ++ specification/_doc_ids/table.csv | 1 + specification/inference/_types/CommonTypes.ts | 2 +- specification/inference/_types/Services.ts | 2 +- .../PutContextualAiRequest.ts | 4 +- 8 files changed, 880 insertions(+), 91 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a416aedf9f..4856422aa1 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -21888,6 +21888,126 @@ ] } }, + "/_inference/{task_type}/{contextualai_inference_id}": { + "put": { + "tags": [ + "inference" + ], + "summary": "Create an Contextual AI inference endpoint", + "description": "Create an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n", + "operationId": "inference-put-contextualai", + "parameters": [ + { + "in": "path", + "name": "task_type", + "description": "The type of the inference task that the model will perform.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/inference._types.TaskTypeContextualAI" + }, + "style": "simple" + }, + { + "in": "path", + "name": "contextualai_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Id" + }, + "style": "simple" + }, + { + "in": "query", + "name": "timeout", + "description": "Specifies the amount of time to wait for the inference endpoint to be created.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chunking_settings": { + "externalDocs": { + "url": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config" + }, + "description": "The chunking configuration object.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings" + } + ] + }, + "service": { + "description": "The type of service supported for the specified task type. In this case, `contextualai`.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAIServiceType" + } + ] + }, + "service_settings": { + "description": "Settings used to install the inference model. These settings are specific to the `contextualai` service.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAIServiceSettings" + } + ] + }, + "task_settings": { + "description": "Settings to configure the inference task.\nThese settings are specific to the task type you specified.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAITaskSettings" + } + ] + } + }, + "required": [ + "service", + "service_settings" + ] + }, + "examples": { + "PutContextualAiRequestExample1": { + "summary": "A rerank task", + "description": "Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service.", + "value": "{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" + } + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inference._types.InferenceEndpointInfoContextualAi" + } + } + } + } + }, + "x-state": "Generally available; Added in 9.2.0", + "x-metaTags": [ + { + "content": "Elasticsearch, Machine Learning", + "name": "product_name" + } + ] + } + }, "/_inference/{task_type}/{custom_inference_id}": { "put": { "tags": [ @@ -100841,7 +100961,7 @@ "type": "object", "properties": { "requests_per_minute": { - "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", + "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", "type": "number" } } @@ -101763,6 +101883,89 @@ "completion" ] }, + "inference._types.TaskTypeContextualAI": { + "type": "string", + "enum": [ + "rerank" + ] + }, + "inference._types.ContextualAIServiceType": { + "type": "string", + "enum": [ + "contextualai" + ] + }, + "inference._types.ContextualAIServiceSettings": { + "type": "object", + "properties": { + "api_key": { + "description": "A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.", + "type": "string" + }, + "model_id": { + "description": "The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models.", + "type": "string" + }, + "rate_limit": { + "description": "This setting helps to minimize the number of rate limit errors returned from Contextual AI.\nThe `contextualai` service sets a default number of requests allowed per minute depending on the task type.\nFor `rerank`, it is set to `1000`.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.RateLimitSetting" + } + ] + } + }, + "required": [ + "api_key", + "model_id" + ] + }, + "inference._types.ContextualAITaskSettings": { + "type": "object", + "properties": { + "instruction": { + "description": "Instructions for the reranking model. Refer to \nOnly for the `rerank` task type.", + "type": "string" + }, + "return_documents": { + "description": "Whether to return the source documents in the response.\nOnly for the `rerank` task type.", + "default": false, + "type": "boolean" + }, + "top_k": { + "description": "The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.", + "type": "number" + } + } + }, + "inference._types.InferenceEndpointInfoContextualAi": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "inference_id": { + "description": "The inference Id", + "type": "string" + }, + "task_type": { + "description": "The task type", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.TaskTypeContextualAI" + } + ] + } + }, + "required": [ + "inference_id", + "task_type" + ] + } + ] + }, "inference._types.CustomTaskType": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2431ed80ef..082f6d09d9 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -12872,6 +12872,126 @@ ] } }, + "/_inference/{task_type}/{contextualai_inference_id}": { + "put": { + "tags": [ + "inference" + ], + "summary": "Create an Contextual AI inference endpoint", + "description": "Create an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n", + "operationId": "inference-put-contextualai", + "parameters": [ + { + "in": "path", + "name": "task_type", + "description": "The type of the inference task that the model will perform.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/inference._types.TaskTypeContextualAI" + }, + "style": "simple" + }, + { + "in": "path", + "name": "contextualai_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Id" + }, + "style": "simple" + }, + { + "in": "query", + "name": "timeout", + "description": "Specifies the amount of time to wait for the inference endpoint to be created.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chunking_settings": { + "externalDocs": { + "url": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config" + }, + "description": "The chunking configuration object.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings" + } + ] + }, + "service": { + "description": "The type of service supported for the specified task type. In this case, `contextualai`.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAIServiceType" + } + ] + }, + "service_settings": { + "description": "Settings used to install the inference model. These settings are specific to the `contextualai` service.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAIServiceSettings" + } + ] + }, + "task_settings": { + "description": "Settings to configure the inference task.\nThese settings are specific to the task type you specified.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.ContextualAITaskSettings" + } + ] + } + }, + "required": [ + "service", + "service_settings" + ] + }, + "examples": { + "PutContextualAiRequestExample1": { + "summary": "A rerank task", + "description": "Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service.", + "value": "{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" + } + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inference._types.InferenceEndpointInfoContextualAi" + } + } + } + } + }, + "x-state": "Generally available", + "x-metaTags": [ + { + "content": "Elasticsearch, Machine Learning", + "name": "product_name" + } + ] + } + }, "/_inference/{task_type}/{custom_inference_id}": { "put": { "tags": [ @@ -65001,7 +65121,7 @@ "type": "object", "properties": { "requests_per_minute": { - "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", + "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", "type": "number" } } @@ -65923,6 +66043,89 @@ "completion" ] }, + "inference._types.TaskTypeContextualAI": { + "type": "string", + "enum": [ + "rerank" + ] + }, + "inference._types.ContextualAIServiceType": { + "type": "string", + "enum": [ + "contextualai" + ] + }, + "inference._types.ContextualAIServiceSettings": { + "type": "object", + "properties": { + "api_key": { + "description": "A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.", + "type": "string" + }, + "model_id": { + "description": "The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models.", + "type": "string" + }, + "rate_limit": { + "description": "This setting helps to minimize the number of rate limit errors returned from Contextual AI.\nThe `contextualai` service sets a default number of requests allowed per minute depending on the task type.\nFor `rerank`, it is set to `1000`.", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.RateLimitSetting" + } + ] + } + }, + "required": [ + "api_key", + "model_id" + ] + }, + "inference._types.ContextualAITaskSettings": { + "type": "object", + "properties": { + "instruction": { + "description": "Instructions for the reranking model. Refer to \nOnly for the `rerank` task type.", + "type": "string" + }, + "return_documents": { + "description": "Whether to return the source documents in the response.\nOnly for the `rerank` task type.", + "default": false, + "type": "boolean" + }, + "top_k": { + "description": "The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.", + "type": "number" + } + } + }, + "inference._types.InferenceEndpointInfoContextualAi": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "inference_id": { + "description": "The inference Id", + "type": "string" + }, + "task_type": { + "description": "The task type", + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.TaskTypeContextualAI" + } + ] + } + }, + "required": [ + "inference_id", + "task_type" + ] + } + ] + }, "inference._types.CustomTaskType": { "type": "string", "enum": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 75a2b0e795..709a891c08 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -10342,6 +10342,51 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, + "stack": { + "since": "9.2.0", + "stability": "stable", + "visibility": "public" + } + }, + "description": "Create an Contextual AI inference endpoint.\n\nCreate an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .", + "docId": "inference-api-put-contextualai", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-contextualai", + "name": "inference.put_contextualai", + "privileges": { + "cluster": [ + "manage_inference" + ] + }, + "request": { + "name": "Request", + "namespace": "inference.put_contextualai" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "inference.put_contextualai" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "PUT" + ], + "path": "/_inference/{task_type}/{contextualai_inference_id}" + } + ] + }, { "availability": { "serverless": { @@ -171139,6 +171184,114 @@ ], "specLocation": "inference/_types/CommonTypes.ts#L123-L135" }, + { + "kind": "interface", + "name": { + "name": "ContextualAIServiceSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "A valid API key for your Contexutual AI account.\n\nIMPORTANT: You need to provide the API key only once, during the inference model creation.\nThe get inference endpoint API does not retrieve your API key.\nAfter creating the inference model, you cannot change the associated API key.\nIf you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.", + "extDocId": "contextualai-api-keys", + "name": "api_key", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The name of the model to use for the inference task.\nRefer to the Contextual AI documentation for the list of available rerank models.", + "extDocId": "contextualai-rerank", + "name": "model_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "This setting helps to minimize the number of rate limit errors returned from Contextual AI.\nThe `contextualai` service sets a default number of requests allowed per minute depending on the task type.\nFor `rerank`, it is set to `1000`.", + "name": "rate_limit", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "RateLimitSetting", + "namespace": "inference._types" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L1202-L1225" + }, + { + "kind": "enum", + "members": [ + { + "name": "contextualai" + } + ], + "name": { + "name": "ContextualAIServiceType", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L1198-L1200" + }, + { + "kind": "interface", + "name": { + "name": "ContextualAITaskSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Instructions for the reranking model. Refer to \nOnly for the `rerank` task type.", + "name": "instruction", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "Whether to return the source documents in the response.\nOnly for the `rerank` task type.", + "name": "return_documents", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The number of most relevant documents to return.\nIf not specified, the reranking results of all documents will be returned.\nOnly for the `rerank` task type.", + "name": "top_k", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L1227-L1245" + }, { "kind": "interface", "name": { @@ -171356,7 +171509,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1198-L1220" + "specLocation": "inference/_types/CommonTypes.ts#L1247-L1269" }, { "kind": "enum", @@ -171369,7 +171522,7 @@ "name": "DeepSeekServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1222-L1224" + "specLocation": "inference/_types/CommonTypes.ts#L1271-L1273" }, { "kind": "interface", @@ -171510,7 +171663,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1226-L1260" + "specLocation": "inference/_types/CommonTypes.ts#L1275-L1309" }, { "kind": "enum", @@ -171523,7 +171676,7 @@ "name": "ElasticsearchServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1276-L1278" + "specLocation": "inference/_types/CommonTypes.ts#L1325-L1327" }, { "kind": "interface", @@ -171546,7 +171699,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1262-L1268" + "specLocation": "inference/_types/CommonTypes.ts#L1311-L1317" }, { "kind": "enum", @@ -171565,7 +171718,7 @@ "name": "ElasticsearchTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1270-L1274" + "specLocation": "inference/_types/CommonTypes.ts#L1319-L1323" }, { "kind": "interface", @@ -171611,7 +171764,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1280-L1306" + "specLocation": "inference/_types/CommonTypes.ts#L1329-L1355" }, { "kind": "enum", @@ -171624,7 +171777,7 @@ "name": "ElserServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1312-L1314" + "specLocation": "inference/_types/CommonTypes.ts#L1361-L1363" }, { "kind": "enum", @@ -171637,7 +171790,7 @@ "name": "ElserTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1308-L1310" + "specLocation": "inference/_types/CommonTypes.ts#L1357-L1359" }, { "kind": "enum", @@ -171650,7 +171803,7 @@ "name": "GoogleAiServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1339-L1341" + "specLocation": "inference/_types/CommonTypes.ts#L1388-L1390" }, { "kind": "interface", @@ -171698,7 +171851,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1316-L1332" + "specLocation": "inference/_types/CommonTypes.ts#L1365-L1381" }, { "kind": "enum", @@ -171714,7 +171867,7 @@ "name": "GoogleAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1334-L1337" + "specLocation": "inference/_types/CommonTypes.ts#L1383-L1386" }, { "kind": "interface", @@ -171788,7 +171941,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1343-L1369" + "specLocation": "inference/_types/CommonTypes.ts#L1392-L1418" }, { "kind": "enum", @@ -171801,7 +171954,7 @@ "name": "GoogleVertexAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1402-L1404" + "specLocation": "inference/_types/CommonTypes.ts#L1451-L1453" }, { "kind": "interface", @@ -171849,7 +172002,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1371-L1386" + "specLocation": "inference/_types/CommonTypes.ts#L1420-L1435" }, { "kind": "enum", @@ -171871,7 +172024,7 @@ "name": "GoogleVertexAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1395-L1400" + "specLocation": "inference/_types/CommonTypes.ts#L1444-L1449" }, { "kind": "interface", @@ -171933,7 +172086,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1406-L1438" + "specLocation": "inference/_types/CommonTypes.ts#L1455-L1487" }, { "kind": "enum", @@ -171946,7 +172099,7 @@ "name": "HuggingFaceServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1459-L1461" + "specLocation": "inference/_types/CommonTypes.ts#L1508-L1510" }, { "kind": "interface", @@ -171980,7 +172133,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1440-L1450" + "specLocation": "inference/_types/CommonTypes.ts#L1489-L1499" }, { "kind": "enum", @@ -172002,7 +172155,7 @@ "name": "HuggingFaceTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1452-L1457" + "specLocation": "inference/_types/CommonTypes.ts#L1501-L1506" }, { "kind": "interface", @@ -172094,7 +172247,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L313-L372" + "specLocation": "inference/_types/Services.ts#L325-L384" }, { "kind": "interface", @@ -172153,7 +172306,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L47-L67" + "specLocation": "inference/_types/Services.ts#L48-L68" }, { "kind": "interface", @@ -172194,7 +172347,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L69-L81" + "specLocation": "inference/_types/Services.ts#L70-L82" }, { "kind": "interface", @@ -172234,7 +172387,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L83-L92" + "specLocation": "inference/_types/Services.ts#L84-L93" }, { "kind": "interface", @@ -172274,7 +172427,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L94-L103" + "specLocation": "inference/_types/Services.ts#L95-L104" }, { "kind": "interface", @@ -172314,7 +172467,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L105-L114" + "specLocation": "inference/_types/Services.ts#L106-L115" }, { "kind": "interface", @@ -172354,7 +172507,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L116-L125" + "specLocation": "inference/_types/Services.ts#L117-L126" }, { "kind": "interface", @@ -172394,7 +172547,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L127-L136" + "specLocation": "inference/_types/Services.ts#L128-L137" }, { "kind": "interface", @@ -172434,7 +172587,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L138-L147" + "specLocation": "inference/_types/Services.ts#L139-L148" }, { "kind": "interface", @@ -172474,7 +172627,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L149-L158" + "specLocation": "inference/_types/Services.ts#L150-L159" }, { "kind": "interface", @@ -172514,7 +172667,47 @@ } } ], - "specLocation": "inference/_types/Services.ts#L160-L169" + "specLocation": "inference/_types/Services.ts#L161-L170" + }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "InferenceEndpoint", + "namespace": "inference._types" + } + }, + "name": { + "name": "InferenceEndpointInfoContextualAi", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "The inference Id", + "name": "inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The task type", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TaskTypeContextualAI", + "namespace": "inference._types" + } + } + } + ], + "specLocation": "inference/_types/Services.ts#L172-L181" }, { "kind": "interface", @@ -172554,7 +172747,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L171-L180" + "specLocation": "inference/_types/Services.ts#L183-L192" }, { "kind": "interface", @@ -172594,7 +172787,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L181-L190" + "specLocation": "inference/_types/Services.ts#L193-L202" }, { "kind": "interface", @@ -172634,7 +172827,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L203-L212" + "specLocation": "inference/_types/Services.ts#L215-L224" }, { "kind": "interface", @@ -172674,7 +172867,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L192-L201" + "specLocation": "inference/_types/Services.ts#L204-L213" }, { "kind": "interface", @@ -172714,7 +172907,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L214-L223" + "specLocation": "inference/_types/Services.ts#L226-L235" }, { "kind": "interface", @@ -172754,7 +172947,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L225-L234" + "specLocation": "inference/_types/Services.ts#L237-L246" }, { "kind": "interface", @@ -172794,7 +172987,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L236-L245" + "specLocation": "inference/_types/Services.ts#L248-L257" }, { "kind": "interface", @@ -172834,7 +173027,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L247-L256" + "specLocation": "inference/_types/Services.ts#L259-L268" }, { "kind": "interface", @@ -172874,7 +173067,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L258-L267" + "specLocation": "inference/_types/Services.ts#L270-L279" }, { "kind": "interface", @@ -172914,7 +173107,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L269-L278" + "specLocation": "inference/_types/Services.ts#L281-L290" }, { "kind": "interface", @@ -172954,7 +173147,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L280-L289" + "specLocation": "inference/_types/Services.ts#L292-L301" }, { "kind": "interface", @@ -172994,7 +173187,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L291-L300" + "specLocation": "inference/_types/Services.ts#L303-L312" }, { "kind": "interface", @@ -173034,7 +173227,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L302-L311" + "specLocation": "inference/_types/Services.ts#L314-L323" }, { "kind": "interface", @@ -173194,7 +173387,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1463-L1492" + "specLocation": "inference/_types/CommonTypes.ts#L1512-L1541" }, { "kind": "enum", @@ -173207,7 +173400,7 @@ "name": "JinaAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1522-L1524" + "specLocation": "inference/_types/CommonTypes.ts#L1571-L1573" }, { "kind": "enum", @@ -173226,7 +173419,7 @@ "name": "JinaAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1526-L1530" + "specLocation": "inference/_types/CommonTypes.ts#L1575-L1579" }, { "kind": "interface", @@ -173272,7 +173465,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1494-L1515" + "specLocation": "inference/_types/CommonTypes.ts#L1543-L1564" }, { "kind": "enum", @@ -173288,7 +173481,7 @@ "name": "JinaAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1517-L1520" + "specLocation": "inference/_types/CommonTypes.ts#L1566-L1569" }, { "kind": "enum", @@ -173310,7 +173503,7 @@ "name": "JinaAITextEmbeddingTask", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1532-L1537" + "specLocation": "inference/_types/CommonTypes.ts#L1581-L1586" }, { "kind": "interface", @@ -173382,7 +173575,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1539-L1569" + "specLocation": "inference/_types/CommonTypes.ts#L1588-L1618" }, { "kind": "enum", @@ -173395,7 +173588,7 @@ "name": "LlamaServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1577-L1579" + "specLocation": "inference/_types/CommonTypes.ts#L1626-L1628" }, { "kind": "enum", @@ -173414,7 +173607,7 @@ "name": "LlamaSimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1581-L1585" + "specLocation": "inference/_types/CommonTypes.ts#L1630-L1634" }, { "kind": "enum", @@ -173433,7 +173626,7 @@ "name": "LlamaTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1571-L1575" + "specLocation": "inference/_types/CommonTypes.ts#L1620-L1624" }, { "kind": "interface", @@ -173591,7 +173784,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1587-L1614" + "specLocation": "inference/_types/CommonTypes.ts#L1636-L1663" }, { "kind": "enum", @@ -173604,7 +173797,7 @@ "name": "MistralServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1622-L1624" + "specLocation": "inference/_types/CommonTypes.ts#L1671-L1673" }, { "kind": "enum", @@ -173623,7 +173816,7 @@ "name": "MistralTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1616-L1620" + "specLocation": "inference/_types/CommonTypes.ts#L1665-L1669" }, { "kind": "interface", @@ -173710,7 +173903,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1626-L1668" + "specLocation": "inference/_types/CommonTypes.ts#L1675-L1717" }, { "kind": "enum", @@ -173723,7 +173916,7 @@ "name": "OpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1684-L1686" + "specLocation": "inference/_types/CommonTypes.ts#L1733-L1735" }, { "kind": "interface", @@ -173745,7 +173938,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1670-L1676" + "specLocation": "inference/_types/CommonTypes.ts#L1719-L1725" }, { "kind": "enum", @@ -173764,7 +173957,7 @@ "name": "OpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1678-L1682" + "specLocation": "inference/_types/CommonTypes.ts#L1727-L1731" }, { "kind": "interface", @@ -173819,7 +174012,7 @@ }, "properties": [ { - "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", + "description": "The number of requests allowed per minute.\nBy default, the number of requests allowed per minute is set by each service as follows:\n\n* `alibabacloud-ai-search` service: `1000`\n* `anthropic` service: `50`\n* `azureaistudio` service: `240`\n* `azureopenai` service and task type `text_embedding`: `1440`\n* `azureopenai` service and task type `completion`: `120`\n* `cohere` service: `10000`\n* `contextualai` service: `1000`\n* `elastic` service and task type `chat_completion`: `240`\n* `googleaistudio` service: `360`\n* `googlevertexai` service: `30000`\n* `hugging_face` service: `3000`\n* `jinaai` service: `2000`\n* `llama` service: `3000`\n* `mistral` service: `240`\n* `openai` service and task type `text_embedding`: `3000`\n* `openai` service and task type `completion`: `500`\n* `voyageai` service: `2000`\n* `watsonxai` service: `120`", "name": "requests_per_minute", "required": false, "type": { @@ -173831,7 +174024,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L378-L405" + "specLocation": "inference/_types/Services.ts#L390-L418" }, { "kind": "interface", @@ -173979,7 +174172,7 @@ "name": "ServiceSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L374-L374", + "specLocation": "inference/_types/Services.ts#L386-L386", "type": { "kind": "user_defined_value" } @@ -174063,7 +174256,7 @@ "name": "TaskSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L376-L376", + "specLocation": "inference/_types/Services.ts#L388-L388", "type": { "kind": "user_defined_value" } @@ -174239,6 +174432,19 @@ }, "specLocation": "inference/_types/TaskType.ts#L76-L80" }, + { + "kind": "enum", + "members": [ + { + "name": "rerank" + } + ], + "name": { + "name": "TaskTypeContextualAI", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/TaskType.ts#L82-L84" + }, { "kind": "enum", "members": [ @@ -174259,7 +174465,7 @@ "name": "TaskTypeCustom", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L82-L87" + "specLocation": "inference/_types/TaskType.ts#L86-L91" }, { "kind": "enum", @@ -174275,7 +174481,7 @@ "name": "TaskTypeDeepSeek", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L89-L92" + "specLocation": "inference/_types/TaskType.ts#L93-L96" }, { "kind": "enum", @@ -174288,7 +174494,7 @@ "name": "TaskTypeELSER", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L100-L102" + "specLocation": "inference/_types/TaskType.ts#L104-L106" }, { "kind": "enum", @@ -174307,7 +174513,7 @@ "name": "TaskTypeElasticsearch", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L94-L98" + "specLocation": "inference/_types/TaskType.ts#L98-L102" }, { "kind": "enum", @@ -174323,7 +174529,7 @@ "name": "TaskTypeGoogleAIStudio", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L104-L107" + "specLocation": "inference/_types/TaskType.ts#L108-L111" }, { "kind": "enum", @@ -174339,7 +174545,7 @@ "name": "TaskTypeGoogleVertexAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L109-L112" + "specLocation": "inference/_types/TaskType.ts#L113-L116" }, { "kind": "enum", @@ -174361,7 +174567,7 @@ "name": "TaskTypeHuggingFace", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L114-L119" + "specLocation": "inference/_types/TaskType.ts#L118-L123" }, { "kind": "enum", @@ -174396,7 +174602,7 @@ "name": "TaskTypeLlama", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L121-L125" + "specLocation": "inference/_types/TaskType.ts#L125-L129" }, { "kind": "enum", @@ -174415,7 +174621,7 @@ "name": "TaskTypeMistral", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L127-L131" + "specLocation": "inference/_types/TaskType.ts#L131-L135" }, { "kind": "enum", @@ -174434,7 +174640,7 @@ "name": "TaskTypeOpenAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L133-L137" + "specLocation": "inference/_types/TaskType.ts#L137-L141" }, { "kind": "enum", @@ -174450,7 +174656,7 @@ "name": "TaskTypeVoyageAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L139-L142" + "specLocation": "inference/_types/TaskType.ts#L143-L146" }, { "kind": "enum", @@ -174469,7 +174675,7 @@ "name": "TaskTypeWatsonx", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L144-L148" + "specLocation": "inference/_types/TaskType.ts#L148-L152" }, { "kind": "interface", @@ -174591,7 +174797,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1388-L1393" + "specLocation": "inference/_types/CommonTypes.ts#L1437-L1442" }, { "kind": "interface", @@ -174737,7 +174943,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1688-L1719" + "specLocation": "inference/_types/CommonTypes.ts#L1737-L1768" }, { "kind": "enum", @@ -174750,7 +174956,7 @@ "name": "VoyageAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1752-L1754" + "specLocation": "inference/_types/CommonTypes.ts#L1801-L1803" }, { "kind": "interface", @@ -174810,7 +175016,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1721-L1745" + "specLocation": "inference/_types/CommonTypes.ts#L1770-L1794" }, { "kind": "enum", @@ -174826,7 +175032,7 @@ "name": "VoyageAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1747-L1750" + "specLocation": "inference/_types/CommonTypes.ts#L1796-L1799" }, { "kind": "interface", @@ -174914,7 +175120,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1756-L1794" + "specLocation": "inference/_types/CommonTypes.ts#L1805-L1843" }, { "kind": "enum", @@ -174927,7 +175133,7 @@ "name": "WatsonxServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1802-L1804" + "specLocation": "inference/_types/CommonTypes.ts#L1851-L1853" }, { "kind": "enum", @@ -174946,7 +175152,7 @@ "name": "WatsonxTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1796-L1800" + "specLocation": "inference/_types/CommonTypes.ts#L1845-L1849" }, { "kind": "request", @@ -177418,6 +177624,147 @@ }, "specLocation": "inference/put_cohere/PutCohereResponse.ts#L22-L25" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "The chunking configuration object.", + "extDocId": "inference-chunking", + "extDocUrl": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + } + } + }, + { + "description": "The type of service supported for the specified task type. In this case, `contextualai`.", + "name": "service", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ContextualAIServiceType", + "namespace": "inference._types" + } + } + }, + { + "description": "Settings used to install the inference model. These settings are specific to the `contextualai` service.", + "name": "service_settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ContextualAIServiceSettings", + "namespace": "inference._types" + } + } + }, + { + "description": "Settings to configure the inference task.\nThese settings are specific to the task type you specified.", + "name": "task_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ContextualAITaskSettings", + "namespace": "inference._types" + } + } + } + ] + }, + "description": "Create an Contextual AI inference endpoint.\n\nCreate an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .", + "examples": { + "PutContextualAiRequestExample1": { + "description": "Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service.", + "method_request": "PUT _inference/rerank/contextualai-rerank", + "summary": "A rerank task", + "value": "{\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n}" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "inference.put_contextualai" + }, + "path": [ + { + "description": "The type of the inference task that the model will perform.", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TaskTypeContextualAI", + "namespace": "inference._types" + } + } + }, + { + "description": "The unique identifier of the inference endpoint.", + "name": "contextualai_inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [ + { + "description": "Specifies the amount of time to wait for the inference endpoint to be created.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "inference/put_contextualai/PutContextualAiRequest.ts#L31-L87" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "endpoint_info", + "value": { + "kind": "instance_of", + "type": { + "name": "InferenceEndpointInfoContextualAi", + "namespace": "inference._types" + } + } + }, + "name": { + "name": "Response", + "namespace": "inference.put_contextualai" + }, + "specLocation": "inference/put_contextualai/PutContextualAiResponse.ts#L22-L25" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 04b2414291..1655e0c6ac 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14014,6 +14014,20 @@ export interface InferenceContentObject { type: string } +export interface InferenceContextualAIServiceSettings { + api_key: string + model_id: string + rate_limit?: InferenceRateLimitSetting +} + +export type InferenceContextualAIServiceType = 'contextualai' + +export interface InferenceContextualAITaskSettings { + instruction?: string + return_documents?: boolean + top_k?: integer +} + export interface InferenceCustomRequestParams { content: string } @@ -14187,6 +14201,11 @@ export interface InferenceInferenceEndpointInfoCohere extends InferenceInference task_type: InferenceTaskTypeCohere } +export interface InferenceInferenceEndpointInfoContextualAi extends InferenceInferenceEndpoint { + inference_id: string + task_type: InferenceTaskTypeContextualAI +} + export interface InferenceInferenceEndpointInfoCustom extends InferenceInferenceEndpoint { inference_id: string task_type: InferenceTaskTypeCustom @@ -14390,6 +14409,8 @@ export type InferenceTaskTypeAzureOpenAI = 'text_embedding' | 'completion' export type InferenceTaskTypeCohere = 'text_embedding' | 'rerank' | 'completion' +export type InferenceTaskTypeContextualAI = 'rerank' + export type InferenceTaskTypeCustom = 'text_embedding' | 'sparse_embedding' | 'rerank' | 'completion' export type InferenceTaskTypeDeepSeek = 'completion' | 'chat_completion' @@ -14646,6 +14667,20 @@ export interface InferencePutCohereRequest extends RequestBase { export type InferencePutCohereResponse = InferenceInferenceEndpointInfoCohere +export interface InferencePutContextualaiRequest extends RequestBase { + task_type: InferenceTaskTypeContextualAI + contextualai_inference_id: Id + timeout?: Duration + body?: { + chunking_settings?: InferenceInferenceChunkingSettings + service: InferenceContextualAIServiceType + service_settings: InferenceContextualAIServiceSettings + task_settings?: InferenceContextualAITaskSettings + } +} + +export type InferencePutContextualaiResponse = InferenceInferenceEndpointInfoContextualAi + export interface InferencePutCustomRequest extends RequestBase { task_type: InferenceCustomTaskType custom_inference_id: Id diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 5c45b9fbc1..56723575d7 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -372,6 +372,7 @@ inference-api-put-anthropic,https://www.elastic.co/docs/api/doc/elasticsearch/op inference-api-put-azureaistudio,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-ai-studio.html, inference-api-put-azureopenai,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-openai.html, inference-api-put-cohere,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-cohere.html, +inference-api-put-contextualai,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-contextualai,, inference-api-put-custom,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/infer-service-custom.html, inference-api-put-deepseek,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-deepseek.html, inference-api-put-eis,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-eis,, diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index a08e978698..3bedbe2385 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -1209,7 +1209,7 @@ export class ContextualAIServiceSettings { * If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. * @ext_doc_id contextualai-api-keys */ - api_key: string + api_key: string /** * The name of the model to use for the inference task. * Refer to the Contextual AI documentation for the list of available rerank models. diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index 2fa4950441..788604d1d1 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -29,7 +29,7 @@ import { TaskTypeAzureAIStudio, TaskTypeAzureOpenAI, TaskTypeCohere, - TaskTypeContextualAI, + TaskTypeContextualAI, TaskTypeCustom, TaskTypeDeepSeek, TaskTypeElasticsearch, diff --git a/specification/inference/put_contextualai/PutContextualAiRequest.ts b/specification/inference/put_contextualai/PutContextualAiRequest.ts index 07619f4578..fefd3fb051 100644 --- a/specification/inference/put_contextualai/PutContextualAiRequest.ts +++ b/specification/inference/put_contextualai/PutContextualAiRequest.ts @@ -20,13 +20,13 @@ import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' import { Duration } from '@_types/Time' -import { TaskTypeContextualAI } from '@inference/_types/TaskType' import { ContextualAIServiceSettings, ContextualAIServiceType, - ContextualAITaskSettings, + ContextualAITaskSettings } from '@inference/_types/CommonTypes' import { InferenceChunkingSettings } from '@inference/_types/Services' +import { TaskTypeContextualAI } from '@inference/_types/TaskType' /** * Create an Contextual AI inference endpoint.