From 33f45a72d13c848780abefacfd943ddf418a4ac8 Mon Sep 17 00:00:00 2001 From: Tim Grein Date: Thu, 28 Mar 2024 10:31:27 +0100 Subject: [PATCH 1/2] Add inference completion result to spec --- output/schema/schema.json | 38 ++++++++++++++++++++++- output/typescript/types.ts | 5 +++ specification/inference/_types/Results.ts | 8 +++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 8fe498a4ee..32eafc851f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -128269,6 +128269,28 @@ }, "specLocation": "indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30" }, + { + "description": "The completion result object", + "kind": "interface", + "name": { + "name": "CompletionResult", + "namespace": "inference._types" + }, + "properties": [ + { + "name": "result", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/_types/Results.ts#L59-L64" + }, { "description": "Text Embedding results containing bytes are represented as Dense\nVectors of bytes.", "kind": "type_alias", @@ -128356,9 +128378,23 @@ } } } + }, + { + "name": "completion", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "CompletionResult", + "namespace": "inference._types" + } + } + } } ], - "specLocation": "inference/_types/Results.ts#L59-L67", + "specLocation": "inference/_types/Results.ts#L66-L75", "variants": { "kind": "container" } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index afaa4e8841..31517fb04c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11495,6 +11495,10 @@ export interface IndicesValidateQueryResponse { error?: string } +export interface InferenceCompletionResult { + result: string +} + export type InferenceDenseByteVector = byte[] export type InferenceDenseVector = float[] @@ -11503,6 +11507,7 @@ export interface InferenceInferenceResult { text_embedding_bytes?: InferenceTextEmbeddingByteResult[] text_embedding?: InferenceTextEmbeddingResult[] sparse_embedding?: InferenceSparseEmbeddingResult[] + completion?: InferenceCompletionResult[] } export interface InferenceModelConfig { diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index b7cfd981a4..4bd3029f80 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -56,6 +56,13 @@ export class TextEmbeddingResult { embedding: DenseVector } +/** + * The completion result object + */ +export class CompletionResult { + result: string; +} + /** * InferenceResult is an aggregation of mutually exclusive variants * @variants container @@ -64,4 +71,5 @@ export class InferenceResult { text_embedding_bytes?: Array text_embedding?: Array sparse_embedding?: Array + completion?: Array } From 5eaabd5f446890133e3b630ddbb7eede4067af01 Mon Sep 17 00:00:00 2001 From: Tim Grein Date: Thu, 28 Mar 2024 10:34:58 +0100 Subject: [PATCH 2/2] Autoformat --- specification/inference/_types/Results.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index 4bd3029f80..1b1741a236 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -60,7 +60,7 @@ export class TextEmbeddingResult { * The completion result object */ export class CompletionResult { - result: string; + result: string } /**