diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 730da90382..a5dc8e05f9 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -49147,8 +49147,14 @@ }, "version": { "$ref": "#/components/schemas/_types:VersionNumber" + }, + "_meta": { + "$ref": "#/components/schemas/_types:Metadata" } - } + }, + "required": [ + "_meta" + ] }, "ingest._types:ProcessorContainer": { "type": "object", diff --git a/output/schema/schema.json b/output/schema/schema.json index 91c0a48a50..6871a8ebc5 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -127426,13 +127426,13 @@ "specLocation": "indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30" }, { - "description": "Text Embedding results are represented as Dense Vectors\nof doubles.", + "description": "Text Embedding results are represented as Dense Vectors\nof floats.", "kind": "type_alias", "name": { "name": "DenseVector", "namespace": "inference._types" }, - "specLocation": "inference/_types/Results.ts#L30-L34", + "specLocation": "inference/_types/Results.ts#L29-L33", "type": { "kind": "array_of", "value": { @@ -127445,31 +127445,45 @@ } }, { - "description": "Inference result is the union of all the result types", - "kind": "type_alias", + "description": "InferenceResult is an aggregation of mutually exclusive variants", + "kind": "interface", "name": { "name": "InferenceResult", "namespace": "inference._types" }, - "specLocation": "inference/_types/Results.ts#L36-L39", - "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "SparseVector", - "namespace": "inference._types" + "properties": [ + { + "name": "text_embedding", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "TextEmbeddingResult", + "namespace": "inference._types" + } } - }, - { - "kind": "instance_of", - "type": { - "name": "DenseVector", - "namespace": "inference._types" + } + }, + { + "name": "sparse_vector", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SparseVector", + "namespace": "inference._types" + } } } - ], - "kind": "union_of" + } + ], + "specLocation": "inference/_types/Results.ts#L42-L49", + "variants": { + "kind": "container" } }, { @@ -127517,7 +127531,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L22-L38" + "specLocation": "inference/_types/Services.ts#L23-L39" }, { "description": "Represents a model as returned by the GET API", @@ -127588,16 +127602,18 @@ } } ], - "specLocation": "inference/_types/Services.ts#L40-L64" + "specLocation": "inference/_types/Services.ts#L41-L65" }, { - "kind": "interface", + "kind": "type_alias", "name": { "name": "ServiceSettings", "namespace": "inference._types" }, - "properties": [], - "specLocation": "inference/_types/Services.ts#L66-L66" + "specLocation": "inference/_types/Services.ts#L67-L67", + "type": { + "kind": "user_defined_value" + } }, { "description": "Sparse Embedding tokens are represented as a dictionary\nof string to double.", @@ -127606,7 +127622,7 @@ "name": "SparseVector", "namespace": "inference._types" }, - "specLocation": "inference/_types/Results.ts#L23-L28", + "specLocation": "inference/_types/Results.ts#L23-L27", "type": { "key": { "kind": "instance_of", @@ -127627,13 +127643,15 @@ } }, { - "kind": "interface", + "kind": "type_alias", "name": { "name": "TaskSettings", "namespace": "inference._types" }, - "properties": [], - "specLocation": "inference/_types/Services.ts#L68-L68" + "specLocation": "inference/_types/Services.ts#L69-L69", + "type": { + "kind": "user_defined_value" + } }, { "kind": "enum", @@ -127651,6 +127669,28 @@ }, "specLocation": "inference/_types/TaskType.ts#L20-L26" }, + { + "description": "The text embedding result object", + "kind": "interface", + "name": { + "name": "TextEmbeddingResult", + "namespace": "inference._types" + }, + "properties": [ + { + "name": "embedding", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DenseVector", + "namespace": "inference._types" + } + } + } + ], + "specLocation": "inference/_types/Results.ts#L35-L40" + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -127874,27 +127914,21 @@ }, { "body": { - "kind": "properties", - "properties": [ - { - "name": "predicted_value", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "InferenceResult", - "namespace": "inference._types" - } - } + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "InferenceResult", + "namespace": "inference._types" } - ] + } }, "kind": "response", "name": { "name": "Response", "namespace": "inference.inference" }, - "specLocation": "inference/inference/InferenceResponse.ts#L22-L26" + "specLocation": "inference/inference/InferenceResponse.ts#L22-L24" }, { "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index fbc1d82b7a..a3077e8cbc 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11435,7 +11435,10 @@ export interface IndicesValidateQueryResponse { export type InferenceDenseVector = float[] -export type InferenceInferenceResult = InferenceSparseVector | InferenceDenseVector +export interface InferenceInferenceResult { + text_embedding?: InferenceTextEmbeddingResult[] + sparse_vector?: InferenceSparseVector[] +} export interface InferenceModelConfig { service: string @@ -11451,18 +11454,18 @@ export interface InferenceModelConfigContainer { task_settings: InferenceTaskSettings } -export interface InferenceServiceSettings { - [key: string]: never -} +export type InferenceServiceSettings = any export type InferenceSparseVector = Record -export interface InferenceTaskSettings { - [key: string]: never -} +export type InferenceTaskSettings = any export type InferenceTaskType = 'sparse_embedding' | 'text_embedding' +export interface InferenceTextEmbeddingResult { + embedding: InferenceDenseVector +} + export interface InferenceDeleteModelRequest extends RequestBase { task_type: InferenceTaskType model_id: Id @@ -11486,9 +11489,7 @@ export interface InferenceInferenceRequest extends RequestBase { } } -export interface InferenceInferenceResponse { - predicted_value: InferenceInferenceResult -} +export type InferenceInferenceResponse = InferenceInferenceResult export interface InferencePutModelRequest extends RequestBase { task_type: InferenceTaskType diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index 2071311913..0612ce8c04 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -24,16 +24,26 @@ import { Dictionary } from '@spec_utils/Dictionary' * Sparse Embedding tokens are represented as a dictionary * of string to double. */ - export type SparseVector = Dictionary /** * Text Embedding results are represented as Dense Vectors - * of doubles. + * of floats. */ export type DenseVector = Array /** - * Inference result is the union of all the result types + * The text embedding result object + */ +export class TextEmbeddingResult { + embedding: DenseVector +} + +/** + * InferenceResult is an aggregation of mutually exclusive variants + * @variants container */ -export type InferenceResult = SparseVector | DenseVector +export class InferenceResult { + text_embedding?: Array + sparse_vector?: Array +} diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index b32413a88d..e408ee206c 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -18,6 +18,7 @@ */ import { TaskType } from '../_types/TaskType' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' /** * Configuration options when storing the model config @@ -63,6 +64,6 @@ export class ModelConfigContainer { task_settings: TaskSettings } -export class ServiceSettings {} +export type ServiceSettings = UserDefinedValue -export class TaskSettings {} +export type TaskSettings = UserDefinedValue diff --git a/specification/inference/inference/InferenceResponse.ts b/specification/inference/inference/InferenceResponse.ts index 7eab41b37f..842d9a4f27 100644 --- a/specification/inference/inference/InferenceResponse.ts +++ b/specification/inference/inference/InferenceResponse.ts @@ -20,7 +20,5 @@ import { InferenceResult } from '@inference/_types/Results' export class Response { - body: { - predicted_value: InferenceResult - } + body: InferenceResult }