From 3a0cc32bc437a5782b52de7d3d5509fbb4914019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 12 Mar 2025 13:00:29 +0100 Subject: [PATCH 1/7] Adds EIS POST inference details. --- output/openapi/elasticsearch-openapi.json | 140 ++++++++ .../elasticsearch-serverless-openapi.json | 140 ++++++++ output/schema/schema-serverless.json | 308 ++++++++++++++++++ output/schema/schema.json | 308 ++++++++++++++++++ output/typescript/types.ts | 29 ++ specification/_doc_ids/table.csv | 1 + .../_json_spec/inference.post.eis.json | 35 ++ .../inference/post_eis/PostEisRequest.ts | 114 +++++++ .../inference/post_eis/PostEisResponse.ts | 24 ++ .../examples/PostEisRequestExample.yaml | 19 ++ 10 files changed, 1118 insertions(+) create mode 100644 specification/_json_spec/inference.post.eis.json create mode 100644 specification/inference/post_eis/PostEisRequest.ts create mode 100644 specification/inference/post_eis/PostEisResponse.ts create mode 100644 specification/inference/post_eis/examples/PostEisRequestExample.yaml diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 6c45fd480d..176c1217ee 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -17814,6 +17814,95 @@ } }, "x-state": "Added in 8.12.0" + }, + "post": { + "tags": [ + "inference" + ], + "summary": "Performs an inference task through the Elastic Inference Service (EIS)", + "description": "Perform an inference task with the `elastic` service.", + "operationId": "inference-post-eis", + "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.post_eis:EisTaskType" + }, + "style": "simple" + }, + { + "in": "path", + "name": "eis_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "description": "A list of objects representing the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/inference.post_eis:Message" + } + }, + "model": { + "description": "The ID of the model to use.", + "type": "string" + }, + "max_completion_tokens": { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "type": "number" + }, + "stop": { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "type": "array", + "items": { + "type": "string" + } + }, + "temperature": { + "description": "The sampling temperature to use.", + "type": "number" + }, + "top_p": { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "type": "number" + } + }, + "required": [ + "messages" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:StreamResult" + } + } + } + } + }, + "x-state": "Added in 9.0.0" } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -77116,6 +77205,57 @@ "inference._types:ServiceSettings": { "type": "object" }, + "inference.post_eis:EisTaskType": { + "type": "string", + "enum": [ + "chat_completion" + ] + }, + "inference.post_eis:Message": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/inference.post_eis:MessageContent" + }, + "role": { + "description": "The role of the message author.", + "type": "string" + } + }, + "required": [ + "role" + ] + }, + "inference.post_eis:MessageContent": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/inference.post_eis:ContentObject" + } + } + ] + }, + "inference.post_eis:ContentObject": { + "type": "object", + "properties": { + "text": { + "description": "The text content.", + "type": "string" + }, + "type": { + "description": "The type of content.", + "type": "string" + } + }, + "required": [ + "text", + "type" + ] + }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index ef165f4ddf..9eb98b2536 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -9636,6 +9636,95 @@ } }, "x-state": "Added in 8.12.0" + }, + "post": { + "tags": [ + "inference" + ], + "summary": "Performs an inference task through the Elastic Inference Service (EIS)", + "description": "Perform an inference task with the `elastic` service.", + "operationId": "inference-post-eis", + "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.post_eis:EisTaskType" + }, + "style": "simple" + }, + { + "in": "path", + "name": "eis_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "description": "A list of objects representing the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/inference.post_eis:Message" + } + }, + "model": { + "description": "The ID of the model to use.", + "type": "string" + }, + "max_completion_tokens": { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "type": "number" + }, + "stop": { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "type": "array", + "items": { + "type": "string" + } + }, + "temperature": { + "description": "The sampling temperature to use.", + "type": "number" + }, + "top_p": { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "type": "number" + } + }, + "required": [ + "messages" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:StreamResult" + } + } + } + } + }, + "x-state": "Added in 9.0.0" } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -48308,6 +48397,57 @@ "inference._types:ServiceSettings": { "type": "object" }, + "inference.post_eis:EisTaskType": { + "type": "string", + "enum": [ + "chat_completion" + ] + }, + "inference.post_eis:Message": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/inference.post_eis:MessageContent" + }, + "role": { + "description": "The role of the message author.", + "type": "string" + } + }, + "required": [ + "role" + ] + }, + "inference.post_eis:MessageContent": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/inference.post_eis:ContentObject" + } + } + ] + }, + "inference.post_eis:ContentObject": { + "type": "object", + "properties": { + "text": { + "description": "The text content.", + "type": "string" + }, + "type": { + "description": "The type of content.", + "type": "string" + } + }, + "required": [ + "text", + "type" + ] + }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index aa66f92b23..359cfa023d 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -4495,6 +4495,51 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, + "stack": { + "since": "9.0.0", + "stability": "stable", + "visibility": "public" + } + }, + "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "docId": "inference-api-post-eis", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis", + "name": "inference.post_eis", + "privileges": { + "cluster": [ + "manage_inference" + ] + }, + "request": { + "name": "Request", + "namespace": "inference.post_eis" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "inference.post_eis" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_inference/{task_type}/{eis_inference_id}" + } + ] + }, { "availability": { "serverless": { @@ -26936,6 +26981,152 @@ }, "specLocation": "inference/get/GetResponse.ts#L22-L26" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "A list of objects representing the conversation.", + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Message", + "namespace": "inference.post_eis" + } + } + } + }, + { + "description": "The ID of the model to use.", + "name": "model", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "name": "max_completion_tokens", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "name": "stop", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "The sampling temperature to use.", + "name": "temperature", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "name": "top_p", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + } + ] + }, + "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "inference.post_eis" + }, + "path": [ + { + "description": "The type of the inference task that the model will perform.", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EisTaskType", + "namespace": "inference.post_eis" + } + } + }, + { + "description": "The unique identifier of the inference endpoint.", + "name": "eis_inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "inference/post_eis/PostEisRequest.ts#L24-L77" + }, + { + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "StreamResult", + "namespace": "_types" + } + } + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisResponse.ts#L22-L24" + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -100547,6 +100738,88 @@ ], "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L94-L106" }, + { + "kind": "enum", + "members": [ + { + "name": "chat_completion" + } + ], + "name": { + "name": "EisTaskType", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisRequest.ts#L79-L81" + }, + { + "codegenNames": [ + "string", + "object" + ], + "kind": "type_alias", + "name": { + "name": "MessageContent", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisRequest.ts#L83-L86", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ContentObject", + "namespace": "inference.post_eis" + } + } + } + ], + "kind": "union_of" + } + }, + { + "description": "An object style representation of a single portion of a conversation.", + "kind": "interface", + "name": { + "name": "ContentObject", + "namespace": "inference.post_eis" + }, + "properties": [ + { + "description": "The text content.", + "name": "text", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The type of content.", + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/post_eis/PostEisRequest.ts#L88-L100" + }, { "kind": "enum", "members": [ @@ -120919,6 +121192,41 @@ ], "specLocation": "inference/_types/Services.ts#L60-L89" }, + { + "description": "An object representing part of the conversation.", + "kind": "interface", + "name": { + "name": "Message", + "namespace": "inference.post_eis" + }, + "properties": [ + { + "description": "The content of the message.", + "name": "content", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "MessageContent", + "namespace": "inference.post_eis" + } + } + }, + { + "description": "The role of the message author.", + "name": "role", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/post_eis/PostEisRequest.ts#L102-L114" + }, { "kind": "interface", "name": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 8671596959..78534a9f1d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9207,6 +9207,51 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, + "stack": { + "since": "9.0.0", + "stability": "stable", + "visibility": "public" + } + }, + "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "docId": "inference-api-post-eis", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis", + "name": "inference.post_eis", + "privileges": { + "cluster": [ + "manage_inference" + ] + }, + "request": { + "name": "Request", + "namespace": "inference.post_eis" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "inference.post_eis" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_inference/{task_type}/{eis_inference_id}" + } + ] + }, { "availability": { "serverless": { @@ -150256,6 +150301,269 @@ }, "specLocation": "inference/get/GetResponse.ts#L22-L26" }, + { + "kind": "interface", + "description": "An object style representation of a single portion of a conversation.", + "name": { + "name": "ContentObject", + "namespace": "inference.post_eis" + }, + "properties": [ + { + "description": "The text content.", + "name": "text", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The type of content.", + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/post_eis/PostEisRequest.ts#L88-L100" + }, + { + "kind": "enum", + "members": [ + { + "name": "chat_completion" + } + ], + "name": { + "name": "EisTaskType", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisRequest.ts#L79-L81" + }, + { + "kind": "interface", + "description": "An object representing part of the conversation.", + "name": { + "name": "Message", + "namespace": "inference.post_eis" + }, + "properties": [ + { + "description": "The content of the message.", + "name": "content", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "MessageContent", + "namespace": "inference.post_eis" + } + } + }, + { + "description": "The role of the message author.", + "name": "role", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/post_eis/PostEisRequest.ts#L102-L114" + }, + { + "kind": "type_alias", + "codegenNames": [ + "string", + "object" + ], + "name": { + "name": "MessageContent", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisRequest.ts#L83-L86", + "type": { + "kind": "union_of", + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ContentObject", + "namespace": "inference.post_eis" + } + } + } + ] + } + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "A list of objects representing the conversation.", + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Message", + "namespace": "inference.post_eis" + } + } + } + }, + { + "description": "The ID of the model to use.", + "name": "model", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "name": "max_completion_tokens", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "name": "stop", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "The sampling temperature to use.", + "name": "temperature", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "name": "top_p", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + } + ] + }, + "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "inference.post_eis" + }, + "path": [ + { + "description": "The type of the inference task that the model will perform.", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "EisTaskType", + "namespace": "inference.post_eis" + } + } + }, + { + "description": "The unique identifier of the inference endpoint.", + "name": "eis_inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "inference/post_eis/PostEisRequest.ts#L24-L77" + }, + { + "kind": "response", + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "StreamResult", + "namespace": "_types" + } + } + }, + "name": { + "name": "Response", + "namespace": "inference.post_eis" + }, + "specLocation": "inference/post_eis/PostEisResponse.ts#L22-L24" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ce67705ca0..d359067323 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13237,6 +13237,35 @@ export interface InferenceGetResponse { endpoints: InferenceInferenceEndpointInfo[] } +export interface InferencePostEisContentObject { + text: string + type: string +} + +export type InferencePostEisEisTaskType = 'chat_completion' + +export interface InferencePostEisMessage { + content?: InferencePostEisMessageContent + role: string +} + +export type InferencePostEisMessageContent = string | InferencePostEisContentObject[] + +export interface InferencePostEisRequest extends RequestBase { + task_type: InferencePostEisEisTaskType + eis_inference_id: Id + body?: { + messages: InferencePostEisMessage[] + model?: string + max_completion_tokens?: long + stop?: string[] + temperature?: float + top_p?: float + } +} + +export type InferencePostEisResponse = StreamResult + export interface InferencePutRequest extends RequestBase { task_type?: InferenceTaskType inference_id: Id diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index d793dd61e5..a72384a688 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -316,6 +316,7 @@ infer-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/ref inference-api-delete,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete inference-api-get,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get inference-api-post,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference +inference-api-post-eis,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis inference-api-put,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put inference-api-put-eis,https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-eis.html inference-api-put-openai,https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-openai.html diff --git a/specification/_json_spec/inference.post.eis.json b/specification/_json_spec/inference.post.eis.json new file mode 100644 index 0000000000..801f2de2a2 --- /dev/null +++ b/specification/_json_spec/inference.post.eis.json @@ -0,0 +1,35 @@ +{ + "inference.post_eis": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html", + "description": "Perform an inference task via the Elastic Inference Service (EIS)" + }, + "stability": "stable", + "visibility": "public", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_inference/{task_type}/{eis_inference_id}", + "methods": ["POST"], + "parts": { + "task_type": { + "type": "string", + "description": "The task type" + }, + "eis_inference_id": { + "type": "string", + "description": "The inference ID" + } + } + } + ] + }, + "body": { + "description": "The inference tasks settings to perform" + } + } +} diff --git a/specification/inference/post_eis/PostEisRequest.ts b/specification/inference/post_eis/PostEisRequest.ts new file mode 100644 index 0000000000..1693d8a409 --- /dev/null +++ b/specification/inference/post_eis/PostEisRequest.ts @@ -0,0 +1,114 @@ +/* + * 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 { float, long } from '@_types/Numeric' + +/** + * Performs an inference task through the Elastic Inference Service (EIS). + * + * Perform an inference task with the `elastic` service. + * @rest_spec_name inference.post_eis + * @availability stack since=9.0.0 stability=stable visibility=public + * @availability serverless stability=stable visibility=public + * @cluster_privileges manage_inference + * @doc_id inference-api-post-eis + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_inference/{task_type}/{eis_inference_id}' + methods: ['POST'] + } + ] + path_parts: { + /** + * The type of the inference task that the model will perform. + */ + task_type: EisTaskType + /** + * The unique identifier of the inference endpoint. + */ + eis_inference_id: Id + } + body: { + /** + * A list of objects representing the conversation. + */ + messages: Array + /** + * The ID of the model to use. + */ + model?: string + /** + * The upper bound limit for the number of tokens that can be generated for a completion request. + */ + max_completion_tokens?: long + /** + * A sequence of strings to control when the model should stop generating additional tokens. + */ + stop?: Array + /** + * The sampling temperature to use. + */ + temperature?: float + /** + * Nucleus sampling, an alternative to sampling with temperature. + */ + top_p?: float + } +} + +export enum EisTaskType { + chat_completion +} + +/** + * @codegen_names string, object + */ +export type MessageContent = string | Array + +/** + * An object style representation of a single portion of a conversation. + */ +export interface ContentObject { + /** + * The text content. + */ + text: string + /** + * The type of content. + */ + type: string +} + +/** + * An object representing part of the conversation. + */ +export interface Message { + /** + * The content of the message. + */ + content?: MessageContent + /** + * The role of the message author. + */ + role: string +} diff --git a/specification/inference/post_eis/PostEisResponse.ts b/specification/inference/post_eis/PostEisResponse.ts new file mode 100644 index 0000000000..74b823bf40 --- /dev/null +++ b/specification/inference/post_eis/PostEisResponse.ts @@ -0,0 +1,24 @@ +/* + * 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 { StreamResult } from '@_types/Binary' + +export class Response { + body: StreamResult +} diff --git a/specification/inference/post_eis/examples/PostEisRequestExample.yaml b/specification/inference/post_eis/examples/PostEisRequestExample.yaml new file mode 100644 index 0000000000..8e6803d58a --- /dev/null +++ b/specification/inference/post_eis/examples/PostEisRequestExample.yaml @@ -0,0 +1,19 @@ +summary: A chat completion task +description: Run `POST /_inference/chat_completion//_stream` to perform a streaming chat completion task type. +# method_request: "POST /_inference/chat_completion/.rainbow-sprinkles-elastic/_stream" +# type: "request" +value: |- + { + "model_id": ".rainbow-sprinkles-elastic", + "task": "chat_completion", + "parameters": + "messages": [ + { + "role": "user", + "content": "Say yes if it works." + } + ], + "temperature": 0.7, + "max_completion_tokens": 300 + } + } From 7027ec0350722949dc45d79651ec4108d07a2051 Mon Sep 17 00:00:00 2001 From: Jonathan Buttner Date: Wed, 12 Mar 2025 09:08:38 -0400 Subject: [PATCH 2/7] Jonathans suggestion for chat completion eis --- .../inference/post_eis/PostEisRequest.ts | 68 ++----------------- 1 file changed, 6 insertions(+), 62 deletions(-) diff --git a/specification/inference/post_eis/PostEisRequest.ts b/specification/inference/post_eis/PostEisRequest.ts index 1693d8a409..1037abe622 100644 --- a/specification/inference/post_eis/PostEisRequest.ts +++ b/specification/inference/post_eis/PostEisRequest.ts @@ -17,9 +17,11 @@ * under the License. */ -import { RequestBase } from '@_types/Base' +import type { Request as RequestChatCompletion } from '../chat_completion_unified/UnifiedRequest' import { Id } from '@_types/common' -import { float, long } from '@_types/Numeric' + + +export type OmittedChatCompletionRequest = Omit; /** * Performs an inference task through the Elastic Inference Service (EIS). @@ -31,10 +33,10 @@ import { float, long } from '@_types/Numeric' * @cluster_privileges manage_inference * @doc_id inference-api-post-eis */ -export interface Request extends RequestBase { +export interface Request extends OmittedChatCompletionRequest { urls: [ { - path: '/_inference/{task_type}/{eis_inference_id}' + path: '/_inference/{task_type}/{eis_inference_id}/_stream' methods: ['POST'] } ] @@ -48,67 +50,9 @@ export interface Request extends RequestBase { */ eis_inference_id: Id } - body: { - /** - * A list of objects representing the conversation. - */ - messages: Array - /** - * The ID of the model to use. - */ - model?: string - /** - * The upper bound limit for the number of tokens that can be generated for a completion request. - */ - max_completion_tokens?: long - /** - * A sequence of strings to control when the model should stop generating additional tokens. - */ - stop?: Array - /** - * The sampling temperature to use. - */ - temperature?: float - /** - * Nucleus sampling, an alternative to sampling with temperature. - */ - top_p?: float - } } export enum EisTaskType { chat_completion } -/** - * @codegen_names string, object - */ -export type MessageContent = string | Array - -/** - * An object style representation of a single portion of a conversation. - */ -export interface ContentObject { - /** - * The text content. - */ - text: string - /** - * The type of content. - */ - type: string -} - -/** - * An object representing part of the conversation. - */ -export interface Message { - /** - * The content of the message. - */ - content?: MessageContent - /** - * The role of the message author. - */ - role: string -} From efbb186f5cf52f2e4c3bb39d871c1c54dfd247de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 12 Mar 2025 14:31:13 +0100 Subject: [PATCH 3/7] Amends example. --- .../inference/post_eis/examples/PostEisRequestExample.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/inference/post_eis/examples/PostEisRequestExample.yaml b/specification/inference/post_eis/examples/PostEisRequestExample.yaml index 8e6803d58a..575da1bfa6 100644 --- a/specification/inference/post_eis/examples/PostEisRequestExample.yaml +++ b/specification/inference/post_eis/examples/PostEisRequestExample.yaml @@ -4,8 +4,6 @@ description: Run `POST /_inference/chat_completion//_stream` to perfor # type: "request" value: |- { - "model_id": ".rainbow-sprinkles-elastic", - "task": "chat_completion", "parameters": "messages": [ { From 2faae2b2a7eab0e85fadae5cbe0b81b048b7d3d3 Mon Sep 17 00:00:00 2001 From: Jonathan Buttner Date: Wed, 12 Mar 2025 09:25:01 -0400 Subject: [PATCH 4/7] Trying to fix make generate --- specification/inference/post_eis/PostEisRequest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/inference/post_eis/PostEisRequest.ts b/specification/inference/post_eis/PostEisRequest.ts index 1037abe622..20d1962f62 100644 --- a/specification/inference/post_eis/PostEisRequest.ts +++ b/specification/inference/post_eis/PostEisRequest.ts @@ -21,7 +21,7 @@ import type { Request as RequestChatCompletion } from '../chat_completion_unifie import { Id } from '@_types/common' -export type OmittedChatCompletionRequest = Omit; +export type OmittedChatCompletion = Omit; /** * Performs an inference task through the Elastic Inference Service (EIS). @@ -33,7 +33,7 @@ export type OmittedChatCompletionRequest = Omit Date: Thu, 13 Mar 2025 15:41:20 +0100 Subject: [PATCH 5/7] Renames files. --- specification/_doc_ids/table.csv | 2 +- ...t.eis.json => inference.post.eis_chat_completion.json} | 6 +++--- .../PostEisChatCompletionRequest.ts} | 8 ++++---- .../PostEisChatCompletionResponse.ts} | 0 .../examples/PostEisChatCompletionRequestExample.yaml} | 0 5 files changed, 8 insertions(+), 8 deletions(-) rename specification/_json_spec/{inference.post.eis.json => inference.post.eis_chat_completion.json} (78%) rename specification/inference/{post_eis/PostEisRequest.ts => post_eis_chat_completion/PostEisChatCompletionRequest.ts} (86%) rename specification/inference/{post_eis/PostEisResponse.ts => post_eis_chat_completion/PostEisChatCompletionResponse.ts} (100%) rename specification/inference/{post_eis/examples/PostEisRequestExample.yaml => post_eis_chat_completion/examples/PostEisChatCompletionRequestExample.yaml} (100%) diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index a72384a688..9532dedc92 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -316,7 +316,7 @@ infer-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/ref inference-api-delete,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete inference-api-get,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get inference-api-post,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference -inference-api-post-eis,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis +inference-api-post-eis-chat-completion,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion inference-api-put,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put inference-api-put-eis,https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-eis.html inference-api-put-openai,https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-openai.html diff --git a/specification/_json_spec/inference.post.eis.json b/specification/_json_spec/inference.post.eis_chat_completion.json similarity index 78% rename from specification/_json_spec/inference.post.eis.json rename to specification/_json_spec/inference.post.eis_chat_completion.json index 801f2de2a2..195c9257f2 100644 --- a/specification/_json_spec/inference.post.eis.json +++ b/specification/_json_spec/inference.post.eis_chat_completion.json @@ -1,8 +1,8 @@ { - "inference.post_eis": { + "inference.post.eis_chat_completion": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html", - "description": "Perform an inference task via the Elastic Inference Service (EIS)" + "description": "Perform a chat completion task via the Elastic Inference Service (EIS)" }, "stability": "stable", "visibility": "public", @@ -13,7 +13,7 @@ "url": { "paths": [ { - "path": "/_inference/{task_type}/{eis_inference_id}", + "path": "/_inference/chat_completion/{eis_inference_id}/_stream", "methods": ["POST"], "parts": { "task_type": { diff --git a/specification/inference/post_eis/PostEisRequest.ts b/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts similarity index 86% rename from specification/inference/post_eis/PostEisRequest.ts rename to specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts index 20d1962f62..ec7c2a4e81 100644 --- a/specification/inference/post_eis/PostEisRequest.ts +++ b/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts @@ -24,14 +24,14 @@ import { Id } from '@_types/common' export type OmittedChatCompletion = Omit; /** - * Performs an inference task through the Elastic Inference Service (EIS). + * Perform a chat completion task through the Elastic Inference Service (EIS). * - * Perform an inference task with the `elastic` service. - * @rest_spec_name inference.post_eis + * Perform a chat completion inference task with the `elastic` service. + * @rest_spec_name inference.post.eis_chat_completion * @availability stack since=9.0.0 stability=stable visibility=public * @availability serverless stability=stable visibility=public * @cluster_privileges manage_inference - * @doc_id inference-api-post-eis + * @doc_id inference-api-post-eis-chat-completion */ export interface Request extends OmittedChatCompletion { urls: [ diff --git a/specification/inference/post_eis/PostEisResponse.ts b/specification/inference/post_eis_chat_completion/PostEisChatCompletionResponse.ts similarity index 100% rename from specification/inference/post_eis/PostEisResponse.ts rename to specification/inference/post_eis_chat_completion/PostEisChatCompletionResponse.ts diff --git a/specification/inference/post_eis/examples/PostEisRequestExample.yaml b/specification/inference/post_eis_chat_completion/examples/PostEisChatCompletionRequestExample.yaml similarity index 100% rename from specification/inference/post_eis/examples/PostEisRequestExample.yaml rename to specification/inference/post_eis_chat_completion/examples/PostEisChatCompletionRequestExample.yaml From 913d5859847a109de9769e65c4b9e5d0673fae05 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Mon, 24 Mar 2025 12:37:40 +0100 Subject: [PATCH 6/7] eis chat completion and unified cc request refactor --- output/openapi/elasticsearch-openapi.json | 351 ++----------- .../elasticsearch-serverless-openapi.json | 351 ++----------- output/schema/schema-serverless.json | 477 ++++++------------ output/schema/schema.json | 477 ++++++------------ output/schema/validation-errors.json | 6 + output/typescript/types.ts | 51 +- ...> inference.post_eis_chat_completion.json} | 2 +- specification/inference/_types/CommonTypes.ts | 61 +++ .../chat_completion_unified/UnifiedRequest.ts | 39 +- .../PostEisChatCompletionRequest.ts | 20 +- 10 files changed, 460 insertions(+), 1375 deletions(-) rename specification/_json_spec/{inference.post.eis_chat_completion.json => inference.post_eis_chat_completion.json} (95%) create mode 100644 specification/inference/_types/CommonTypes.ts diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 176c1217ee..95658b6f4e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -17451,52 +17451,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "messages": { - "description": "A list of objects representing the conversation.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:Message" - } - }, - "model": { - "description": "The ID of the model to use.", - "type": "string" - }, - "max_completion_tokens": { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "type": "number" - }, - "stop": { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "type": "array", - "items": { - "type": "string" - } - }, - "temperature": { - "description": "The sampling temperature to use.", - "type": "number" - }, - "tool_choice": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolType" - }, - "tools": { - "description": "A list of tools that the model can call.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionTool" - } - }, - "top_p": { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "type": "number" - } - }, - "required": [ - "messages" - ] + "type": "object" } } } @@ -17748,23 +17703,23 @@ "x-state": "Added in 8.11.0" } }, - "/_inference/{task_type}/{eis_inference_id}": { - "put": { + "/_inference/{task_type}/{eis_inference_id}/_stream": { + "post": { "tags": [ "inference" ], - "summary": "Create an Elastic Inference Service (EIS) inference endpoint", - "description": "Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).", - "operationId": "inference-put-eis", + "summary": "Perform a chat completion task through the Elastic Inference Service (EIS)", + "description": "Perform a chat completion inference task with the `elastic` service.", + "operationId": "inference-post-eis-chat-completion", "parameters": [ { "in": "path", "name": "task_type", - "description": "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API.", + "description": "The type of the inference task that the model will perform.", "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/inference.put_eis:EisTaskType" + "$ref": "#/components/schemas/inference.post_eis_chat_completion:EisTaskType" }, "style": "simple" }, @@ -17784,19 +17739,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "service": { - "$ref": "#/components/schemas/inference.put_eis:ServiceType" - }, - "service_settings": { - "$ref": "#/components/schemas/inference.put_eis:EisServiceSettings" - } - }, - "required": [ - "service", - "service_settings" - ] + "type": "object" } } } @@ -17807,30 +17750,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/inference._types:InferenceEndpointInfo" + "$ref": "#/components/schemas/_types:StreamResult" } } } } }, - "x-state": "Added in 8.12.0" - }, - "post": { + "x-state": "Added in 9.0.0" + } + }, + "/_inference/{task_type}/{eis_inference_id}": { + "put": { "tags": [ "inference" ], - "summary": "Performs an inference task through the Elastic Inference Service (EIS)", - "description": "Perform an inference task with the `elastic` service.", - "operationId": "inference-post-eis", + "summary": "Create an Elastic Inference Service (EIS) inference endpoint", + "description": "Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).", + "operationId": "inference-put-eis", "parameters": [ { "in": "path", "name": "task_type", - "description": "The type of the inference task that the model will perform.", + "description": "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API.", "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/inference.post_eis:EisTaskType" + "$ref": "#/components/schemas/inference.put_eis:EisTaskType" }, "style": "simple" }, @@ -17852,39 +17797,16 @@ "schema": { "type": "object", "properties": { - "messages": { - "description": "A list of objects representing the conversation.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.post_eis:Message" - } - }, - "model": { - "description": "The ID of the model to use.", - "type": "string" - }, - "max_completion_tokens": { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "type": "number" - }, - "stop": { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "type": "array", - "items": { - "type": "string" - } - }, - "temperature": { - "description": "The sampling temperature to use.", - "type": "number" + "service": { + "$ref": "#/components/schemas/inference.put_eis:ServiceType" }, - "top_p": { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "type": "number" + "service_settings": { + "$ref": "#/components/schemas/inference.put_eis:EisServiceSettings" } }, "required": [ - "messages" + "service", + "service_settings" ] } } @@ -17896,13 +17818,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types:StreamResult" + "$ref": "#/components/schemas/inference._types:InferenceEndpointInfo" } } } } }, - "x-state": "Added in 9.0.0" + "x-state": "Added in 8.12.0" } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -76897,176 +76819,6 @@ "valid" ] }, - "inference.chat_completion_unified:Message": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/inference.chat_completion_unified:MessageContent" - }, - "role": { - "description": "The role of the message author.", - "type": "string" - }, - "tool_call_id": { - "$ref": "#/components/schemas/_types:Id" - }, - "tool_calls": { - "description": "The tool calls generated by the model.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ToolCall" - } - } - }, - "required": [ - "role" - ] - }, - "inference.chat_completion_unified:MessageContent": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ContentObject" - } - } - ] - }, - "inference.chat_completion_unified:ContentObject": { - "type": "object", - "properties": { - "text": { - "description": "The text content.", - "type": "string" - }, - "type": { - "description": "The type of content.", - "type": "string" - } - }, - "required": [ - "text", - "type" - ] - }, - "inference.chat_completion_unified:ToolCall": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/_types:Id" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ToolCallFunction" - }, - "type": { - "description": "The type of the tool call.", - "type": "string" - } - }, - "required": [ - "id", - "function", - "type" - ] - }, - "inference.chat_completion_unified:ToolCallFunction": { - "type": "object", - "properties": { - "arguments": { - "description": "The arguments to call the function with in JSON format.", - "type": "string" - }, - "name": { - "description": "The name of the function to call.", - "type": "string" - } - }, - "required": [ - "arguments", - "name" - ] - }, - "inference.chat_completion_unified:CompletionToolType": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolChoice" - } - ] - }, - "inference.chat_completion_unified:CompletionToolChoice": { - "type": "object", - "properties": { - "type": { - "description": "The type of the tool.", - "type": "string" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolChoiceFunction" - } - }, - "required": [ - "type", - "function" - ] - }, - "inference.chat_completion_unified:CompletionToolChoiceFunction": { - "type": "object", - "properties": { - "name": { - "description": "The name of the function to call.", - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "inference.chat_completion_unified:CompletionTool": { - "type": "object", - "properties": { - "type": { - "description": "The type of tool.", - "type": "string" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolFunction" - } - }, - "required": [ - "type", - "function" - ] - }, - "inference.chat_completion_unified:CompletionToolFunction": { - "type": "object", - "properties": { - "description": { - "description": "A description of what the function does.\nThis is used by the model to choose when and how to call the function.", - "type": "string" - }, - "name": { - "description": "The name of the function.", - "type": "string" - }, - "parameters": { - "description": "The parameters the functional accepts. This should be formatted as a JSON object.", - "type": "object" - }, - "strict": { - "description": "Whether to enable schema adherence when generating the function call.", - "type": "boolean" - } - }, - "required": [ - "name" - ] - }, "_types:StreamResult": { "type": "object" }, @@ -77205,57 +76957,12 @@ "inference._types:ServiceSettings": { "type": "object" }, - "inference.post_eis:EisTaskType": { + "inference.post_eis_chat_completion:EisTaskType": { "type": "string", "enum": [ "chat_completion" ] }, - "inference.post_eis:Message": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/inference.post_eis:MessageContent" - }, - "role": { - "description": "The role of the message author.", - "type": "string" - } - }, - "required": [ - "role" - ] - }, - "inference.post_eis:MessageContent": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.post_eis:ContentObject" - } - } - ] - }, - "inference.post_eis:ContentObject": { - "type": "object", - "properties": { - "text": { - "description": "The text content.", - "type": "string" - }, - "type": { - "description": "The type of content.", - "type": "string" - } - }, - "required": [ - "text", - "type" - ] - }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 9eb98b2536..50024b78a0 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -9273,52 +9273,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "messages": { - "description": "A list of objects representing the conversation.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:Message" - } - }, - "model": { - "description": "The ID of the model to use.", - "type": "string" - }, - "max_completion_tokens": { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "type": "number" - }, - "stop": { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "type": "array", - "items": { - "type": "string" - } - }, - "temperature": { - "description": "The sampling temperature to use.", - "type": "number" - }, - "tool_choice": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolType" - }, - "tools": { - "description": "A list of tools that the model can call.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionTool" - } - }, - "top_p": { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "type": "number" - } - }, - "required": [ - "messages" - ] + "type": "object" } } } @@ -9570,23 +9525,23 @@ "x-state": "Added in 8.11.0" } }, - "/_inference/{task_type}/{eis_inference_id}": { - "put": { + "/_inference/{task_type}/{eis_inference_id}/_stream": { + "post": { "tags": [ "inference" ], - "summary": "Create an Elastic Inference Service (EIS) inference endpoint", - "description": "Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).", - "operationId": "inference-put-eis", + "summary": "Perform a chat completion task through the Elastic Inference Service (EIS)", + "description": "Perform a chat completion inference task with the `elastic` service.", + "operationId": "inference-post-eis-chat-completion", "parameters": [ { "in": "path", "name": "task_type", - "description": "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API.", + "description": "The type of the inference task that the model will perform.", "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/inference.put_eis:EisTaskType" + "$ref": "#/components/schemas/inference.post_eis_chat_completion:EisTaskType" }, "style": "simple" }, @@ -9606,19 +9561,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "service": { - "$ref": "#/components/schemas/inference.put_eis:ServiceType" - }, - "service_settings": { - "$ref": "#/components/schemas/inference.put_eis:EisServiceSettings" - } - }, - "required": [ - "service", - "service_settings" - ] + "type": "object" } } } @@ -9629,30 +9572,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/inference._types:InferenceEndpointInfo" + "$ref": "#/components/schemas/_types:StreamResult" } } } } }, - "x-state": "Added in 8.12.0" - }, - "post": { + "x-state": "Added in 9.0.0" + } + }, + "/_inference/{task_type}/{eis_inference_id}": { + "put": { "tags": [ "inference" ], - "summary": "Performs an inference task through the Elastic Inference Service (EIS)", - "description": "Perform an inference task with the `elastic` service.", - "operationId": "inference-post-eis", + "summary": "Create an Elastic Inference Service (EIS) inference endpoint", + "description": "Create an inference endpoint to perform an inference task through the Elastic Inference Service (EIS).", + "operationId": "inference-put-eis", "parameters": [ { "in": "path", "name": "task_type", - "description": "The type of the inference task that the model will perform.", + "description": "The type of the inference task that the model will perform.\nNOTE: The `chat_completion` task type only supports streaming and only through the _stream API.", "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/inference.post_eis:EisTaskType" + "$ref": "#/components/schemas/inference.put_eis:EisTaskType" }, "style": "simple" }, @@ -9674,39 +9619,16 @@ "schema": { "type": "object", "properties": { - "messages": { - "description": "A list of objects representing the conversation.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.post_eis:Message" - } - }, - "model": { - "description": "The ID of the model to use.", - "type": "string" - }, - "max_completion_tokens": { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "type": "number" - }, - "stop": { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "type": "array", - "items": { - "type": "string" - } - }, - "temperature": { - "description": "The sampling temperature to use.", - "type": "number" + "service": { + "$ref": "#/components/schemas/inference.put_eis:ServiceType" }, - "top_p": { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "type": "number" + "service_settings": { + "$ref": "#/components/schemas/inference.put_eis:EisServiceSettings" } }, "required": [ - "messages" + "service", + "service_settings" ] } } @@ -9718,13 +9640,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/_types:StreamResult" + "$ref": "#/components/schemas/inference._types:InferenceEndpointInfo" } } } } }, - "x-state": "Added in 9.0.0" + "x-state": "Added in 8.12.0" } }, "/_inference/{task_type}/{openai_inference_id}": { @@ -48089,176 +48011,6 @@ "valid" ] }, - "inference.chat_completion_unified:Message": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/inference.chat_completion_unified:MessageContent" - }, - "role": { - "description": "The role of the message author.", - "type": "string" - }, - "tool_call_id": { - "$ref": "#/components/schemas/_types:Id" - }, - "tool_calls": { - "description": "The tool calls generated by the model.", - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ToolCall" - } - } - }, - "required": [ - "role" - ] - }, - "inference.chat_completion_unified:MessageContent": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ContentObject" - } - } - ] - }, - "inference.chat_completion_unified:ContentObject": { - "type": "object", - "properties": { - "text": { - "description": "The text content.", - "type": "string" - }, - "type": { - "description": "The type of content.", - "type": "string" - } - }, - "required": [ - "text", - "type" - ] - }, - "inference.chat_completion_unified:ToolCall": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/_types:Id" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:ToolCallFunction" - }, - "type": { - "description": "The type of the tool call.", - "type": "string" - } - }, - "required": [ - "id", - "function", - "type" - ] - }, - "inference.chat_completion_unified:ToolCallFunction": { - "type": "object", - "properties": { - "arguments": { - "description": "The arguments to call the function with in JSON format.", - "type": "string" - }, - "name": { - "description": "The name of the function to call.", - "type": "string" - } - }, - "required": [ - "arguments", - "name" - ] - }, - "inference.chat_completion_unified:CompletionToolType": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolChoice" - } - ] - }, - "inference.chat_completion_unified:CompletionToolChoice": { - "type": "object", - "properties": { - "type": { - "description": "The type of the tool.", - "type": "string" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolChoiceFunction" - } - }, - "required": [ - "type", - "function" - ] - }, - "inference.chat_completion_unified:CompletionToolChoiceFunction": { - "type": "object", - "properties": { - "name": { - "description": "The name of the function to call.", - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "inference.chat_completion_unified:CompletionTool": { - "type": "object", - "properties": { - "type": { - "description": "The type of tool.", - "type": "string" - }, - "function": { - "$ref": "#/components/schemas/inference.chat_completion_unified:CompletionToolFunction" - } - }, - "required": [ - "type", - "function" - ] - }, - "inference.chat_completion_unified:CompletionToolFunction": { - "type": "object", - "properties": { - "description": { - "description": "A description of what the function does.\nThis is used by the model to choose when and how to call the function.", - "type": "string" - }, - "name": { - "description": "The name of the function.", - "type": "string" - }, - "parameters": { - "description": "The parameters the functional accepts. This should be formatted as a JSON object.", - "type": "object" - }, - "strict": { - "description": "Whether to enable schema adherence when generating the function call.", - "type": "boolean" - } - }, - "required": [ - "name" - ] - }, "_types:StreamResult": { "type": "object" }, @@ -48397,57 +48149,12 @@ "inference._types:ServiceSettings": { "type": "object" }, - "inference.post_eis:EisTaskType": { + "inference.post_eis_chat_completion:EisTaskType": { "type": "string", "enum": [ "chat_completion" ] }, - "inference.post_eis:Message": { - "type": "object", - "properties": { - "content": { - "$ref": "#/components/schemas/inference.post_eis:MessageContent" - }, - "role": { - "description": "The role of the message author.", - "type": "string" - } - }, - "required": [ - "role" - ] - }, - "inference.post_eis:MessageContent": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/inference.post_eis:ContentObject" - } - } - ] - }, - "inference.post_eis:ContentObject": { - "type": "object", - "properties": { - "text": { - "description": "The text content.", - "type": "string" - }, - "type": { - "description": "The type of content.", - "type": "string" - } - }, - "required": [ - "text", - "type" - ] - }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 359cfa023d..b4cf96615f 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -4507,10 +4507,10 @@ "visibility": "public" } }, - "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", - "docId": "inference-api-post-eis", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis", - "name": "inference.post_eis", + "description": "Perform a chat completion task through the Elastic Inference Service (EIS).\n\nPerform a chat completion inference task with the `elastic` service.", + "docId": "inference-api-post-eis-chat-completion", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion", + "name": "inference.post_eis_chat_completion", "privileges": { "cluster": [ "manage_inference" @@ -4518,7 +4518,7 @@ }, "request": { "name": "Request", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "requestBodyRequired": false, "requestMediaType": [ @@ -4526,7 +4526,7 @@ ], "response": { "name": "Response", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "responseMediaType": [ "application/json" @@ -4536,7 +4536,7 @@ "methods": [ "POST" ], - "path": "/_inference/{task_type}/{eis_inference_id}" + "path": "/_inference/{task_type}/{eis_inference_id}/_stream" } ] }, @@ -26535,119 +26535,13 @@ ], "body": { "kind": "properties", - "properties": [ - { - "description": "A list of objects representing the conversation.", - "name": "messages", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Message", - "namespace": "inference.chat_completion_unified" - } - } - } - }, - { - "description": "The ID of the model to use.", - "name": "model", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "name": "max_completion_tokens", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "name": "stop", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "description": "The sampling temperature to use.", - "name": "temperature", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "description": "Controls which tool is called by the model.", - "name": "tool_choice", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "CompletionToolType", - "namespace": "inference.chat_completion_unified" - } - } - }, - { - "description": "A list of tools that the model can call.", - "name": "tools", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "CompletionTool", - "namespace": "inference.chat_completion_unified" - } - } - } - }, - { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "name": "top_p", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - } - ] + "properties": [] }, "description": "Perform chat completion inference", "inherits": { "type": { - "name": "RequestBase", - "namespace": "_types" + "name": "RequestChatCompletionBase", + "namespace": "inference._types" } }, "kind": "request", @@ -26684,7 +26578,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L26-L87" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L25-L52" }, { "body": { @@ -26987,98 +26881,19 @@ ], "body": { "kind": "properties", - "properties": [ - { - "description": "A list of objects representing the conversation.", - "name": "messages", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Message", - "namespace": "inference.post_eis" - } - } - } - }, - { - "description": "The ID of the model to use.", - "name": "model", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "name": "max_completion_tokens", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "name": "stop", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "description": "The sampling temperature to use.", - "name": "temperature", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "name": "top_p", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - } - ] + "properties": [] }, - "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "description": "Perform a chat completion task through the Elastic Inference Service (EIS).\n\nPerform a chat completion inference task with the `elastic` service.", "inherits": { "type": { - "name": "RequestBase", - "namespace": "_types" + "name": "RequestChatCompletionBase", + "namespace": "inference._types" } }, "kind": "request", "name": { "name": "Request", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "path": [ { @@ -27089,7 +26904,7 @@ "kind": "instance_of", "type": { "name": "EisTaskType", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" } } }, @@ -27107,7 +26922,7 @@ } ], "query": [], - "specLocation": "inference/post_eis/PostEisRequest.ts#L24-L77" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L50" }, { "body": { @@ -27123,9 +26938,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, - "specLocation": "inference/post_eis/PostEisResponse.ts#L22-L24" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionResponse.ts#L22-L24" }, { "attachedBehaviors": [ @@ -100590,7 +100405,7 @@ "name": "CompletionToolType", "namespace": "inference.chat_completion_unified" }, - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L89-L92", + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L54-L57", "type": { "items": [ { @@ -100644,7 +100459,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L178-L190" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L143-L155" }, { "description": "The tool choice function.", @@ -100667,7 +100482,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L167-L176" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L132-L141" }, { "codegenNames": [ @@ -100679,7 +100494,7 @@ "name": "MessageContent", "namespace": "inference.chat_completion_unified" }, - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L140-L143", + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L105-L108", "type": { "items": [ { @@ -100736,7 +100551,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L94-L106" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L59-L71" }, { "kind": "enum", @@ -100747,78 +100562,9 @@ ], "name": { "name": "EisTaskType", - "namespace": "inference.post_eis" - }, - "specLocation": "inference/post_eis/PostEisRequest.ts#L79-L81" - }, - { - "codegenNames": [ - "string", - "object" - ], - "kind": "type_alias", - "name": { - "name": "MessageContent", - "namespace": "inference.post_eis" - }, - "specLocation": "inference/post_eis/PostEisRequest.ts#L83-L86", - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "ContentObject", - "namespace": "inference.post_eis" - } - } - } - ], - "kind": "union_of" - } - }, - { - "description": "An object style representation of a single portion of a conversation.", - "kind": "interface", - "name": { - "name": "ContentObject", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, - "properties": [ - { - "description": "The text content.", - "name": "text", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The type of content.", - "name": "type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "inference/post_eis/PostEisRequest.ts#L88-L100" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L52-L54" }, { "kind": "enum", @@ -120711,6 +120457,130 @@ ], "specLocation": "indices/validate_query/IndicesValidateQueryResponse.ts#L32-L37" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "interface", + "name": { + "name": "RequestChatCompletionBase", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "A list of objects representing the conversation.", + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Message", + "namespace": "inference.chat_completion_unified" + } + } + } + }, + { + "description": "The ID of the model to use.", + "name": "model", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "name": "max_completion_tokens", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "name": "stop", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "The sampling temperature to use.", + "name": "temperature", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "description": "Controls which tool is called by the model.", + "name": "tool_choice", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "CompletionToolType", + "namespace": "inference.chat_completion_unified" + } + } + }, + { + "description": "A list of tools that the model can call.", + "name": "tools", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "CompletionTool", + "namespace": "inference.chat_completion_unified" + } + } + } + }, + { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "name": "top_p", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L28-L61" + }, { "description": "An object representing part of the conversation.", "kind": "interface", @@ -120771,7 +120641,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L145-L165" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L110-L130" }, { "description": "A tool call generated by the model.", @@ -120818,7 +120688,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L122-L138" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L87-L103" }, { "description": "The function that the model called.", @@ -120853,7 +120723,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L108-L120" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L73-L85" }, { "description": "A list of tools that the model can call.", @@ -120888,7 +120758,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L215-L227" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L180-L192" }, { "description": "The completion tool function definition.", @@ -120943,7 +120813,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L192-L213" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L157-L178" }, { "description": "Defines the completion result.", @@ -121192,41 +121062,6 @@ ], "specLocation": "inference/_types/Services.ts#L60-L89" }, - { - "description": "An object representing part of the conversation.", - "kind": "interface", - "name": { - "name": "Message", - "namespace": "inference.post_eis" - }, - "properties": [ - { - "description": "The content of the message.", - "name": "content", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "MessageContent", - "namespace": "inference.post_eis" - } - } - }, - { - "description": "The role of the message author.", - "name": "role", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "inference/post_eis/PostEisRequest.ts#L102-L114" - }, { "kind": "interface", "name": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 78534a9f1d..59811c0868 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9219,10 +9219,10 @@ "visibility": "public" } }, - "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", - "docId": "inference-api-post-eis", - "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis", - "name": "inference.post_eis", + "description": "Perform a chat completion task through the Elastic Inference Service (EIS).\n\nPerform a chat completion inference task with the `elastic` service.", + "docId": "inference-api-post-eis-chat-completion", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-post-eis-chat-completion", + "name": "inference.post_eis_chat_completion", "privileges": { "cluster": [ "manage_inference" @@ -9230,7 +9230,7 @@ }, "request": { "name": "Request", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "requestBodyRequired": false, "requestMediaType": [ @@ -9238,7 +9238,7 @@ ], "response": { "name": "Response", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "responseMediaType": [ "application/json" @@ -9248,7 +9248,7 @@ "methods": [ "POST" ], - "path": "/_inference/{task_type}/{eis_inference_id}" + "path": "/_inference/{task_type}/{eis_inference_id}/_stream" } ] }, @@ -149212,6 +149212,130 @@ ], "specLocation": "inference/_types/Services.ts#L95-L100" }, + { + "kind": "interface", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "RequestChatCompletionBase", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "A list of objects representing the conversation.", + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Message", + "namespace": "inference.chat_completion_unified" + } + } + } + }, + { + "description": "The ID of the model to use.", + "name": "model", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", + "name": "max_completion_tokens", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "description": "A sequence of strings to control when the model should stop generating additional tokens.", + "name": "stop", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "The sampling temperature to use.", + "name": "temperature", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "description": "Controls which tool is called by the model.", + "name": "tool_choice", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "CompletionToolType", + "namespace": "inference.chat_completion_unified" + } + } + }, + { + "description": "A list of tools that the model can call.", + "name": "tools", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "CompletionTool", + "namespace": "inference.chat_completion_unified" + } + } + } + }, + { + "description": "Nucleus sampling, an alternative to sampling with temperature.", + "name": "top_p", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L28-L61" + }, { "kind": "interface", "description": "Defines the response for a rerank request.", @@ -149490,7 +149614,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L215-L227" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L180-L192" }, { "kind": "interface", @@ -149525,7 +149649,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L178-L190" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L143-L155" }, { "kind": "interface", @@ -149548,7 +149672,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L167-L176" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L132-L141" }, { "kind": "interface", @@ -149603,7 +149727,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L192-L213" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L157-L178" }, { "kind": "type_alias", @@ -149615,7 +149739,7 @@ "name": "CompletionToolType", "namespace": "inference.chat_completion_unified" }, - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L89-L92", + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L54-L57", "type": { "kind": "union_of", "items": [ @@ -149669,7 +149793,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L94-L106" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L59-L71" }, { "kind": "interface", @@ -149731,7 +149855,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L145-L165" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L110-L130" }, { "kind": "type_alias", @@ -149743,7 +149867,7 @@ "name": "MessageContent", "namespace": "inference.chat_completion_unified" }, - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L140-L143", + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L105-L108", "type": { "kind": "union_of", "items": [ @@ -149774,119 +149898,13 @@ ], "body": { "kind": "properties", - "properties": [ - { - "description": "A list of objects representing the conversation.", - "name": "messages", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Message", - "namespace": "inference.chat_completion_unified" - } - } - } - }, - { - "description": "The ID of the model to use.", - "name": "model", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "name": "max_completion_tokens", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "name": "stop", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "description": "The sampling temperature to use.", - "name": "temperature", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "description": "Controls which tool is called by the model.", - "name": "tool_choice", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "CompletionToolType", - "namespace": "inference.chat_completion_unified" - } - } - }, - { - "description": "A list of tools that the model can call.", - "name": "tools", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "CompletionTool", - "namespace": "inference.chat_completion_unified" - } - } - } - }, - { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "name": "top_p", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - } - ] + "properties": [] }, "description": "Perform chat completion inference", "inherits": { "type": { - "name": "RequestBase", - "namespace": "_types" + "name": "RequestChatCompletionBase", + "namespace": "inference._types" } }, "name": { @@ -149922,7 +149940,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L26-L87" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L25-L52" }, { "kind": "response", @@ -149987,7 +150005,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L122-L138" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L87-L103" }, { "kind": "interface", @@ -150022,7 +150040,7 @@ } } ], - "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L108-L120" + "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L73-L85" }, { "kind": "request", @@ -150301,41 +150319,6 @@ }, "specLocation": "inference/get/GetResponse.ts#L22-L26" }, - { - "kind": "interface", - "description": "An object style representation of a single portion of a conversation.", - "name": { - "name": "ContentObject", - "namespace": "inference.post_eis" - }, - "properties": [ - { - "description": "The text content.", - "name": "text", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The type of content.", - "name": "type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "inference/post_eis/PostEisRequest.ts#L88-L100" - }, { "kind": "enum", "members": [ @@ -150345,78 +150328,9 @@ ], "name": { "name": "EisTaskType", - "namespace": "inference.post_eis" - }, - "specLocation": "inference/post_eis/PostEisRequest.ts#L79-L81" - }, - { - "kind": "interface", - "description": "An object representing part of the conversation.", - "name": { - "name": "Message", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, - "properties": [ - { - "description": "The content of the message.", - "name": "content", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "MessageContent", - "namespace": "inference.post_eis" - } - } - }, - { - "description": "The role of the message author.", - "name": "role", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "inference/post_eis/PostEisRequest.ts#L102-L114" - }, - { - "kind": "type_alias", - "codegenNames": [ - "string", - "object" - ], - "name": { - "name": "MessageContent", - "namespace": "inference.post_eis" - }, - "specLocation": "inference/post_eis/PostEisRequest.ts#L83-L86", - "type": { - "kind": "union_of", - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "ContentObject", - "namespace": "inference.post_eis" - } - } - } - ] - } + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L52-L54" }, { "kind": "request", @@ -150425,97 +150339,18 @@ ], "body": { "kind": "properties", - "properties": [ - { - "description": "A list of objects representing the conversation.", - "name": "messages", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "Message", - "namespace": "inference.post_eis" - } - } - } - }, - { - "description": "The ID of the model to use.", - "name": "model", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "description": "The upper bound limit for the number of tokens that can be generated for a completion request.", - "name": "max_completion_tokens", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "description": "A sequence of strings to control when the model should stop generating additional tokens.", - "name": "stop", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "description": "The sampling temperature to use.", - "name": "temperature", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "description": "Nucleus sampling, an alternative to sampling with temperature.", - "name": "top_p", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - } - ] + "properties": [] }, - "description": "Performs an inference task through the Elastic Inference Service (EIS).\n\nPerform an inference task with the `elastic` service.", + "description": "Perform a chat completion task through the Elastic Inference Service (EIS).\n\nPerform a chat completion inference task with the `elastic` service.", "inherits": { "type": { - "name": "RequestBase", - "namespace": "_types" + "name": "RequestChatCompletionBase", + "namespace": "inference._types" } }, "name": { "name": "Request", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, "path": [ { @@ -150526,7 +150361,7 @@ "kind": "instance_of", "type": { "name": "EisTaskType", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" } } }, @@ -150544,7 +150379,7 @@ } ], "query": [], - "specLocation": "inference/post_eis/PostEisRequest.ts#L24-L77" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L50" }, { "kind": "response", @@ -150560,9 +150395,9 @@ }, "name": { "name": "Response", - "namespace": "inference.post_eis" + "namespace": "inference.post_eis_chat_completion" }, - "specLocation": "inference/post_eis/PostEisResponse.ts#L22-L24" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionResponse.ts#L22-L24" }, { "kind": "request", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index babdec33d1..b701ffa7f6 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -56,6 +56,12 @@ ], "response": [] }, + "inference.post_eis_chat_completion": { + "request": [ + "Request: url path '/_inference/{task_type}/{eis_inference_id}/_stream' not found in the json spec" + ], + "response": [] + }, "ingest.get_ip_location_database": { "request": [ "Request: query parameter 'master_timeout' does not exist in the json spec" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index d359067323..89076ae36b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13109,6 +13109,17 @@ export interface InferenceRateLimitSetting { requests_per_minute?: integer } +export interface InferenceRequestChatCompletionBase extends RequestBase { + messages: InferenceChatCompletionUnifiedMessage[] + model?: string + max_completion_tokens?: long + stop?: string[] + temperature?: float + tool_choice?: InferenceChatCompletionUnifiedCompletionToolType + tools?: InferenceChatCompletionUnifiedCompletionTool[] + top_p?: float +} + export interface InferenceRerankedInferenceResult { rerank: InferenceRankedDocument[] } @@ -13180,19 +13191,9 @@ export interface InferenceChatCompletionUnifiedMessage { export type InferenceChatCompletionUnifiedMessageContent = string | InferenceChatCompletionUnifiedContentObject[] -export interface InferenceChatCompletionUnifiedRequest extends RequestBase { +export interface InferenceChatCompletionUnifiedRequest extends InferenceRequestChatCompletionBase { inference_id: Id timeout?: Duration - body?: { - messages: InferenceChatCompletionUnifiedMessage[] - model?: string - max_completion_tokens?: long - stop?: string[] - temperature?: float - tool_choice?: InferenceChatCompletionUnifiedCompletionToolType - tools?: InferenceChatCompletionUnifiedCompletionTool[] - top_p?: float - } } export type InferenceChatCompletionUnifiedResponse = StreamResult @@ -13237,34 +13238,14 @@ export interface InferenceGetResponse { endpoints: InferenceInferenceEndpointInfo[] } -export interface InferencePostEisContentObject { - text: string - type: string -} - -export type InferencePostEisEisTaskType = 'chat_completion' - -export interface InferencePostEisMessage { - content?: InferencePostEisMessageContent - role: string -} +export type InferencePostEisChatCompletionEisTaskType = 'chat_completion' -export type InferencePostEisMessageContent = string | InferencePostEisContentObject[] - -export interface InferencePostEisRequest extends RequestBase { - task_type: InferencePostEisEisTaskType +export interface InferencePostEisChatCompletionRequest extends InferenceRequestChatCompletionBase { + task_type: InferencePostEisChatCompletionEisTaskType eis_inference_id: Id - body?: { - messages: InferencePostEisMessage[] - model?: string - max_completion_tokens?: long - stop?: string[] - temperature?: float - top_p?: float - } } -export type InferencePostEisResponse = StreamResult +export type InferencePostEisChatCompletionResponse = StreamResult export interface InferencePutRequest extends RequestBase { task_type?: InferenceTaskType diff --git a/specification/_json_spec/inference.post.eis_chat_completion.json b/specification/_json_spec/inference.post_eis_chat_completion.json similarity index 95% rename from specification/_json_spec/inference.post.eis_chat_completion.json rename to specification/_json_spec/inference.post_eis_chat_completion.json index 195c9257f2..5c7ade7ff1 100644 --- a/specification/_json_spec/inference.post.eis_chat_completion.json +++ b/specification/_json_spec/inference.post_eis_chat_completion.json @@ -1,5 +1,5 @@ { - "inference.post.eis_chat_completion": { + "inference.post_eis_chat_completion": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html", "description": "Perform a chat completion task via the Elastic Inference Service (EIS)" diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts new file mode 100644 index 0000000000..8879466eb3 --- /dev/null +++ b/specification/inference/_types/CommonTypes.ts @@ -0,0 +1,61 @@ +/* + * 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 { + CompletionTool, + CompletionToolType, + Message +} from '@inference/chat_completion_unified/UnifiedRequest' +import { RequestBase } from '@_types/Base' +import { float, long } from '@_types/Numeric' + +export interface RequestChatCompletionBase extends RequestBase { + /** + * A list of objects representing the conversation. + */ + messages: Array + /** + * The ID of the model to use. + */ + model?: string + /** + * The upper bound limit for the number of tokens that can be generated for a completion request. + */ + max_completion_tokens?: long + /** + * A sequence of strings to control when the model should stop generating additional tokens. + */ + stop?: Array + /** + * The sampling temperature to use. + */ + temperature?: float + /** + * Controls which tool is called by the model. + */ + tool_choice?: CompletionToolType + /** + * A list of tools that the model can call. + */ + tools?: Array + /** + * Nucleus sampling, an alternative to sampling with temperature. + */ + top_p?: float +} diff --git a/specification/inference/chat_completion_unified/UnifiedRequest.ts b/specification/inference/chat_completion_unified/UnifiedRequest.ts index ac460afa95..1932021931 100644 --- a/specification/inference/chat_completion_unified/UnifiedRequest.ts +++ b/specification/inference/chat_completion_unified/UnifiedRequest.ts @@ -17,10 +17,9 @@ * under the License. */ +import { RequestChatCompletionBase } from '@inference/_types/CommonTypes' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' -import { float, long } from '@_types/Numeric' import { Duration } from '@_types/Time' /** @@ -30,7 +29,7 @@ import { Duration } from '@_types/Time' * @availability serverless stability=stable visibility=public * @doc_id inference-api-chat-completion */ -export interface Request extends RequestBase { +export interface Request extends RequestChatCompletionBase { urls: [ { path: '/_inference/chat_completion/{inference_id}/_stream' @@ -50,40 +49,6 @@ export interface Request extends RequestBase { */ timeout?: Duration } - body: { - /** - * A list of objects representing the conversation. - */ - messages: Array - /** - * The ID of the model to use. - */ - model?: string - /** - * The upper bound limit for the number of tokens that can be generated for a completion request. - */ - max_completion_tokens?: long - /** - * A sequence of strings to control when the model should stop generating additional tokens. - */ - stop?: Array - /** - * The sampling temperature to use. - */ - temperature?: float - /** - * Controls which tool is called by the model. - */ - tool_choice?: CompletionToolType - /** - * A list of tools that the model can call. - */ - tools?: Array - /** - * Nucleus sampling, an alternative to sampling with temperature. - */ - top_p?: float - } } /** diff --git a/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts b/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts index ec7c2a4e81..6088a1b0a1 100644 --- a/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts +++ b/specification/inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts @@ -17,42 +17,30 @@ * under the License. */ -import type { Request as RequestChatCompletion } from '../chat_completion_unified/UnifiedRequest' +import { RequestChatCompletionBase } from '@inference/_types/CommonTypes' import { Id } from '@_types/common' - -export type OmittedChatCompletion = Omit; - /** * Perform a chat completion task through the Elastic Inference Service (EIS). * * Perform a chat completion inference task with the `elastic` service. - * @rest_spec_name inference.post.eis_chat_completion + * @rest_spec_name inference.post_eis_chat_completion * @availability stack since=9.0.0 stability=stable visibility=public * @availability serverless stability=stable visibility=public * @cluster_privileges manage_inference * @doc_id inference-api-post-eis-chat-completion */ -export interface Request extends OmittedChatCompletion { +export interface Request extends RequestChatCompletionBase { urls: [ { - path: '/_inference/{task_type}/{eis_inference_id}/_stream' + path: '/_inference/chat_completion/{eis_inference_id}/_stream' methods: ['POST'] } ] path_parts: { - /** - * The type of the inference task that the model will perform. - */ - task_type: EisTaskType /** * The unique identifier of the inference endpoint. */ eis_inference_id: Id } } - -export enum EisTaskType { - chat_completion -} - From 82633b1bbfd6a465aafc845b208ae24a8476cbe5 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Mon, 24 Mar 2025 13:55:36 +0100 Subject: [PATCH 7/7] json spec path fix --- output/openapi/elasticsearch-openapi.json | 19 +----------- .../elasticsearch-serverless-openapi.json | 19 +----------- output/schema/schema-serverless.json | 29 ++----------------- output/schema/schema.json | 29 ++----------------- output/schema/validation-errors.json | 6 ---- output/typescript/types.ts | 3 -- .../inference.post_eis_chat_completion.json | 4 --- 7 files changed, 6 insertions(+), 103 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 95658b6f4e..0e9cfc6281 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -17703,7 +17703,7 @@ "x-state": "Added in 8.11.0" } }, - "/_inference/{task_type}/{eis_inference_id}/_stream": { + "/_inference/chat_completion/{eis_inference_id}/_stream": { "post": { "tags": [ "inference" @@ -17712,17 +17712,6 @@ "description": "Perform a chat completion inference task with the `elastic` service.", "operationId": "inference-post-eis-chat-completion", "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.post_eis_chat_completion:EisTaskType" - }, - "style": "simple" - }, { "in": "path", "name": "eis_inference_id", @@ -76957,12 +76946,6 @@ "inference._types:ServiceSettings": { "type": "object" }, - "inference.post_eis_chat_completion:EisTaskType": { - "type": "string", - "enum": [ - "chat_completion" - ] - }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 50024b78a0..655bd5617d 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -9525,7 +9525,7 @@ "x-state": "Added in 8.11.0" } }, - "/_inference/{task_type}/{eis_inference_id}/_stream": { + "/_inference/chat_completion/{eis_inference_id}/_stream": { "post": { "tags": [ "inference" @@ -9534,17 +9534,6 @@ "description": "Perform a chat completion inference task with the `elastic` service.", "operationId": "inference-post-eis-chat-completion", "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.post_eis_chat_completion:EisTaskType" - }, - "style": "simple" - }, { "in": "path", "name": "eis_inference_id", @@ -48149,12 +48138,6 @@ "inference._types:ServiceSettings": { "type": "object" }, - "inference.post_eis_chat_completion:EisTaskType": { - "type": "string", - "enum": [ - "chat_completion" - ] - }, "inference.put_eis:EisTaskType": { "type": "string", "enum": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index b4cf96615f..ecaa181942 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -4536,7 +4536,7 @@ "methods": [ "POST" ], - "path": "/_inference/{task_type}/{eis_inference_id}/_stream" + "path": "/_inference/chat_completion/{eis_inference_id}/_stream" } ] }, @@ -26896,18 +26896,6 @@ "namespace": "inference.post_eis_chat_completion" }, "path": [ - { - "description": "The type of the inference task that the model will perform.", - "name": "task_type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "EisTaskType", - "namespace": "inference.post_eis_chat_completion" - } - } - }, { "description": "The unique identifier of the inference endpoint.", "name": "eis_inference_id", @@ -26922,7 +26910,7 @@ } ], "query": [], - "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L50" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L46" }, { "body": { @@ -100553,19 +100541,6 @@ ], "specLocation": "inference/chat_completion_unified/UnifiedRequest.ts#L59-L71" }, - { - "kind": "enum", - "members": [ - { - "name": "chat_completion" - } - ], - "name": { - "name": "EisTaskType", - "namespace": "inference.post_eis_chat_completion" - }, - "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L52-L54" - }, { "kind": "enum", "members": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 59811c0868..e84cb90589 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9248,7 +9248,7 @@ "methods": [ "POST" ], - "path": "/_inference/{task_type}/{eis_inference_id}/_stream" + "path": "/_inference/chat_completion/{eis_inference_id}/_stream" } ] }, @@ -150319,19 +150319,6 @@ }, "specLocation": "inference/get/GetResponse.ts#L22-L26" }, - { - "kind": "enum", - "members": [ - { - "name": "chat_completion" - } - ], - "name": { - "name": "EisTaskType", - "namespace": "inference.post_eis_chat_completion" - }, - "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L52-L54" - }, { "kind": "request", "attachedBehaviors": [ @@ -150353,18 +150340,6 @@ "namespace": "inference.post_eis_chat_completion" }, "path": [ - { - "description": "The type of the inference task that the model will perform.", - "name": "task_type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "EisTaskType", - "namespace": "inference.post_eis_chat_completion" - } - } - }, { "description": "The unique identifier of the inference endpoint.", "name": "eis_inference_id", @@ -150379,7 +150354,7 @@ } ], "query": [], - "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L50" + "specLocation": "inference/post_eis_chat_completion/PostEisChatCompletionRequest.ts#L23-L46" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index b701ffa7f6..babdec33d1 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -56,12 +56,6 @@ ], "response": [] }, - "inference.post_eis_chat_completion": { - "request": [ - "Request: url path '/_inference/{task_type}/{eis_inference_id}/_stream' not found in the json spec" - ], - "response": [] - }, "ingest.get_ip_location_database": { "request": [ "Request: query parameter 'master_timeout' does not exist in the json spec" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 89076ae36b..a129e27fbc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13238,10 +13238,7 @@ export interface InferenceGetResponse { endpoints: InferenceInferenceEndpointInfo[] } -export type InferencePostEisChatCompletionEisTaskType = 'chat_completion' - export interface InferencePostEisChatCompletionRequest extends InferenceRequestChatCompletionBase { - task_type: InferencePostEisChatCompletionEisTaskType eis_inference_id: Id } diff --git a/specification/_json_spec/inference.post_eis_chat_completion.json b/specification/_json_spec/inference.post_eis_chat_completion.json index 5c7ade7ff1..e34b14913b 100644 --- a/specification/_json_spec/inference.post_eis_chat_completion.json +++ b/specification/_json_spec/inference.post_eis_chat_completion.json @@ -16,10 +16,6 @@ "path": "/_inference/chat_completion/{eis_inference_id}/_stream", "methods": ["POST"], "parts": { - "task_type": { - "type": "string", - "description": "The task type" - }, "eis_inference_id": { "type": "string", "description": "The inference ID"