From 44e6a1fb4ede2967844cf360f21882c106f067d9 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Wed, 22 Nov 2023 09:38:01 +0000 Subject: [PATCH] Sparse embedding result is an object --- .../elasticsearch-serverless-openapi.json | 1 - output/schema/schema.json | 27 ++++++++++++++++--- output/typescript/types.ts | 6 ++++- specification/inference/_types/Results.ts | 6 ++++- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index a5dc8e05f9..cb216e8cd2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -44278,7 +44278,6 @@ "type", "buffer_size", "delimiter", - "replacement", "reverse", "skip" ] diff --git a/output/schema/schema.json b/output/schema/schema.json index 8c08240ddf..0e3b91b19e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -127474,14 +127474,14 @@ "value": { "kind": "instance_of", "type": { - "name": "SparseVector", + "name": "SparseEmbeddingResult", "namespace": "inference._types" } } } } ], - "specLocation": "inference/_types/Results.ts#L42-L49", + "specLocation": "inference/_types/Results.ts#L46-L53", "variants": { "kind": "container" } @@ -127615,6 +127615,27 @@ "kind": "user_defined_value" } }, + { + "kind": "interface", + "name": { + "name": "SparseEmbeddingResult", + "namespace": "inference._types" + }, + "properties": [ + { + "name": "embedding", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SparseVector", + "namespace": "inference._types" + } + } + } + ], + "specLocation": "inference/_types/Results.ts#L35-L37" + }, { "description": "Sparse Embedding tokens are represented as a dictionary\nof string to double.", "kind": "type_alias", @@ -127689,7 +127710,7 @@ } } ], - "specLocation": "inference/_types/Results.ts#L35-L40" + "specLocation": "inference/_types/Results.ts#L39-L44" }, { "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6c255f34aa..9a810facb5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11437,7 +11437,7 @@ export type InferenceDenseVector = float[] export interface InferenceInferenceResult { text_embedding?: InferenceTextEmbeddingResult[] - sparse_embedding?: InferenceSparseVector[] + sparse_embedding?: InferenceSparseEmbeddingResult[] } export interface InferenceModelConfig { @@ -11456,6 +11456,10 @@ export interface InferenceModelConfigContainer { export type InferenceServiceSettings = any +export interface InferenceSparseEmbeddingResult { + embedding: InferenceSparseVector +} + export type InferenceSparseVector = Record export type InferenceTaskSettings = any diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index b4e86fd28d..e16d49ee9b 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -32,6 +32,10 @@ export type SparseVector = Dictionary */ export type DenseVector = Array +export class SparseEmbeddingResult { + embedding: SparseVector +} + /** * The text embedding result object */ @@ -45,5 +49,5 @@ export class TextEmbeddingResult { */ export class InferenceResult { text_embedding?: Array - sparse_embedding?: Array + sparse_embedding?: Array }