From f43b6ef96eaff7f6f3252643511e4a3e92d8714d Mon Sep 17 00:00:00 2001 From: Kathleen DeRusso Date: Thu, 2 Oct 2025 02:55:47 -0400 Subject: [PATCH] Support inferred model ID for knn queries over semantic text fields (#5390) (cherry picked from commit 1560bbbf45ca63a7b064689bf92a28badf52832c) --- output/schema/schema.json | 11 +++++++++-- output/typescript/types.ts | 2 +- specification/_types/Knn.ts | 8 +++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 9a76f3ce98..c661f31974 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -57484,8 +57484,15 @@ }, "properties": [ { + "availability": { + "serverless": {}, + "stack": { + "since": "8.18.0" + } + }, + "description": "Model ID is required for all dense_vector fields but\nmay be inferred for semantic_text fields", "name": "model_id", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -57506,7 +57513,7 @@ } } ], - "specLocation": "_types/Knn.ts#L94-L97" + "specLocation": "_types/Knn.ts#L94-L103" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ad6d3c1736..85f151a000 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2981,7 +2981,7 @@ export interface TaskFailure { export type TaskId = string | integer export interface TextEmbedding { - model_id: string + model_id?: string model_text: string } diff --git a/specification/_types/Knn.ts b/specification/_types/Knn.ts index 8c315ef9ec..cd63287f67 100644 --- a/specification/_types/Knn.ts +++ b/specification/_types/Knn.ts @@ -92,6 +92,12 @@ export interface QueryVectorBuilder { } export interface TextEmbedding { - model_id: string + /** + * Model ID is required for all dense_vector fields but + * may be inferred for semantic_text fields + * @availability stack since=8.18.0 + * @availability serverless + */ + model_id?: string model_text: string }