From 86fc8ec274f8cfef793cb77c8673cfa32701a7e0 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Wed, 10 Sep 2025 14:35:18 +0100 Subject: [PATCH] Add the `input_type` param to the Perform text embedding inference API --- output/openapi/elasticsearch-openapi.json | 6 +++++- .../elasticsearch-serverless-openapi.json | 6 +++++- output/schema/schema.json | 16 ++++++++++++++-- output/typescript/types.ts | 1 + .../text_embedding/TextEmbeddingRequest.ts | 13 +++++++++++++ .../request/TextEmbeddingRequestExample1.yaml | 4 +--- 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index d07137a412..e7cc36f699 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -23978,6 +23978,10 @@ } ] }, + "input_type": { + "description": "The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.", + "type": "string" + }, "task_settings": { "description": "Optional task settings", "allOf": [ @@ -23995,7 +23999,7 @@ "TextEmbeddingRequestExample1": { "summary": "Text embedding task", "description": "Run `POST _inference/text_embedding/my-cohere-endpoint` to perform text embedding on the example sentence using the Cohere integration,", - "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}" + "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" } } } diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 1b03086536..1567419d0e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -14780,6 +14780,10 @@ } ] }, + "input_type": { + "description": "The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.", + "type": "string" + }, "task_settings": { "description": "Optional task settings", "allOf": [ @@ -14797,7 +14801,7 @@ "TextEmbeddingRequestExample1": { "summary": "Text embedding task", "description": "Run `POST _inference/text_embedding/my-cohere-endpoint` to perform text embedding on the example sentence using the Cohere integration,", - "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}" + "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" } } } diff --git a/output/schema/schema.json b/output/schema/schema.json index 6fe077a875..4c9a0b21b5 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -181190,6 +181190,18 @@ ] } }, + { + "description": "The input data type for the text embedding model. Possible values include:\n* `SEARCH`\n* `INGEST`\n* `CLASSIFICATION`\n* `CLUSTERING`\nNot all services support all values. Unsupported values will trigger a validation exception.\nAccepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.\n\n> info\n> The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`.", + "name": "input_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "description": "Optional task settings", "name": "task_settings", @@ -181236,7 +181248,7 @@ "description": "Run `POST _inference/text_embedding/my-cohere-endpoint` to perform text embedding on the example sentence using the Cohere integration,", "method_request": "POST _inference/text_embedding/my-cohere-endpoint", "summary": "Text embedding task", - "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}" + "value": "{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n}" } }, "inherits": { @@ -181278,7 +181290,7 @@ } } ], - "specLocation": "inference/text_embedding/TextEmbeddingRequest.ts#L25-L63" + "specLocation": "inference/text_embedding/TextEmbeddingRequest.ts#L25-L76" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 88677a4cf4..488d639e82 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14835,6 +14835,7 @@ export interface InferenceTextEmbeddingRequest extends RequestBase { timeout?: Duration body?: { input: string | string[] + input_type?: string task_settings?: InferenceTaskSettings } } diff --git a/specification/inference/text_embedding/TextEmbeddingRequest.ts b/specification/inference/text_embedding/TextEmbeddingRequest.ts index 7d26edb597..48a48792c8 100644 --- a/specification/inference/text_embedding/TextEmbeddingRequest.ts +++ b/specification/inference/text_embedding/TextEmbeddingRequest.ts @@ -55,6 +55,19 @@ export interface Request extends RequestBase { * Either a string or an array of strings. */ input: string | Array + /** + * The input data type for the text embedding model. Possible values include: + * * `SEARCH` + * * `INGEST` + * * `CLASSIFICATION` + * * `CLUSTERING` + * Not all services support all values. Unsupported values will trigger a validation exception. + * Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info. + * + * > info + * > The `input_type` parameter specified on the root level of the request body will take precedence over the `input_type` parameter specified in `task_settings`. + */ + input_type?: string /** * Optional task settings */ diff --git a/specification/inference/text_embedding/examples/request/TextEmbeddingRequestExample1.yaml b/specification/inference/text_embedding/examples/request/TextEmbeddingRequestExample1.yaml index 6ad435dfd2..28f298a956 100644 --- a/specification/inference/text_embedding/examples/request/TextEmbeddingRequestExample1.yaml +++ b/specification/inference/text_embedding/examples/request/TextEmbeddingRequestExample1.yaml @@ -7,7 +7,5 @@ method_request: 'POST _inference/text_embedding/my-cohere-endpoint' value: |- { "input": "The sky above the port was the color of television tuned to a dead channel.", - "task_settings": { - "input_type": "ingest" - } + "input_type": "ingest" }