From 2d2c627d2316fba7cb112929eb31959c8a843011 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Wed, 13 Mar 2024 09:55:48 +0000 Subject: [PATCH 1/2] Add prefix strings to PUT model request --- .../elasticsearch-serverless-openapi.json | 9 +++---- output/schema/schema.json | 27 ++++++++++++++++--- output/typescript/types.ts | 5 ++-- specification/ml/_types/TrainedModel.ts | 4 +-- .../MlPutTrainedModelRequest.ts | 7 +++++ 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index a041ad544b..e791830577 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -10027,6 +10027,9 @@ "items": { "type": "string" } + }, + "prefix_strings": { + "$ref": "#/components/schemas/ml._types:TrainedModelPrefixStrings" } } } @@ -54358,11 +54361,7 @@ "description": "String prepended to input at search", "type": "string" } - }, - "required": [ - "ingest", - "search" - ] + } }, "ml._types:TrainedModelStats": { "type": "object", diff --git a/output/schema/schema.json b/output/schema/schema.json index 497bc2bb8d..27c7764fbc 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -146437,7 +146437,7 @@ { "description": "String prepended to input at ingest", "name": "ingest", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -146449,7 +146449,7 @@ { "description": "String prepended to input at search", "name": "search", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -155887,6 +155887,27 @@ } } } + }, + { + "availability": { + "serverless": { + "since": "8.12.0" + }, + "stack": { + "since": "8.12.0" + } + }, + "description": "Optional prefix strings applied at inference", + "name": "prefix_strings", + "required": false, + "since": "8.12.0", + "type": { + "kind": "instance_of", + "type": { + "name": "TrainedModelPrefixStrings", + "namespace": "ml._types" + } + } } ] }, @@ -155937,7 +155958,7 @@ } } ], - "specLocation": "ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L106" + "specLocation": "ml/put_trained_model/MlPutTrainedModelRequest.ts#L29-L113" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index fca0f9d489..283354643c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13391,8 +13391,8 @@ export interface MlTrainedModelLocationIndex { } export interface MlTrainedModelPrefixStrings { - ingest: string - search: string + ingest?: string + search?: string } export interface MlTrainedModelSizeStats { @@ -14415,6 +14415,7 @@ export interface MlPutTrainedModelRequest extends RequestBase { model_size_bytes?: long platform_architecture?: string tags?: string[] + prefix_strings?: MlTrainedModelPrefixStrings } } diff --git a/specification/ml/_types/TrainedModel.ts b/specification/ml/_types/TrainedModel.ts index acd5c0c64e..c55b106b5f 100644 --- a/specification/ml/_types/TrainedModel.ts +++ b/specification/ml/_types/TrainedModel.ts @@ -429,9 +429,9 @@ export class TrainedModelPrefixStrings { /** * String prepended to input at ingest */ - ingest: string + ingest?: string /** * String prepended to input at search */ - search: string + search?: string } diff --git a/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts b/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts index 4c5b5d0b7d..e8b216e377 100644 --- a/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts +++ b/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts @@ -22,6 +22,7 @@ import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' import { long } from '@_types/Numeric' import { Definition, Input } from './types' +import { TrainedModelPrefixStrings } from '../_types/TrainedModel' import { TrainedModelType } from '../_types/TrainedModel' import { InferenceConfigCreateContainer } from '@ml/_types/inference' @@ -102,5 +103,11 @@ export interface Request extends RequestBase { * An array of tags to organize the model. */ tags?: string[] + /** + * Optional prefix strings applied at inference + * @availability stack since=8.12.0 + * @availability serverless since=8.12.0 + */ + prefix_strings?: TrainedModelPrefixStrings } } From ffa0a1cd895c14af820f45282ab54e6367c7ec2a Mon Sep 17 00:00:00 2001 From: David Kyle Date: Wed, 13 Mar 2024 11:18:02 +0000 Subject: [PATCH 2/2] Update specification/ml/put_trained_model/MlPutTrainedModelRequest.ts Co-authored-by: David Roberts --- specification/ml/put_trained_model/MlPutTrainedModelRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts b/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts index e8b216e377..4cb40ca309 100644 --- a/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts +++ b/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts @@ -106,7 +106,7 @@ export interface Request extends RequestBase { /** * Optional prefix strings applied at inference * @availability stack since=8.12.0 - * @availability serverless since=8.12.0 + * @availability serverless */ prefix_strings?: TrainedModelPrefixStrings }