Skip to content

Commit 2282626

Browse files
authored
Add prefix_string config option for ML models (#2451)
* Add prefix_string config option for ML models (#2363) The prefix_strings option was added to support the E5 model in elastic/elasticsearch#102089 * Add prefix_strings option to PUT model request (#2449) Follow up to #2363 where prefix_strings option was added to TrainedModelConfig
1 parent d63ae8a commit 2282626

File tree

5 files changed

+129
-20
lines changed

5 files changed

+129
-20
lines changed

output/openapi/elasticsearch-serverless-openapi.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

+84-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/ml/_types/TrainedModel.ts

+12
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export class TrainedModelConfig {
196196
metadata?: TrainedModelConfigMetadata
197197
model_size_bytes?: ByteSize
198198
location?: TrainedModelLocation
199+
prefix_strings?: TrainedModelPrefixStrings
199200
}
200201

201202
export class TrainedModelConfigInput {
@@ -423,3 +424,14 @@ export class TrainedModelLocation {
423424
export class TrainedModelLocationIndex {
424425
name: IndexName
425426
}
427+
428+
export class TrainedModelPrefixStrings {
429+
/**
430+
* String prepended to input at ingest
431+
*/
432+
ingest?: string
433+
/**
434+
* String prepended to input at search
435+
*/
436+
search?: string
437+
}

specification/ml/put_trained_model/MlPutTrainedModelRequest.ts

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { RequestBase } from '@_types/Base'
2222
import { Id } from '@_types/common'
2323
import { long } from '@_types/Numeric'
2424
import { Definition, Input } from './types'
25+
import { TrainedModelPrefixStrings } from '../_types/TrainedModel'
2526
import { TrainedModelType } from '../_types/TrainedModel'
2627
import { InferenceConfigCreateContainer } from '@ml/_types/inference'
2728

@@ -102,5 +103,11 @@ export interface Request extends RequestBase {
102103
* An array of tags to organize the model.
103104
*/
104105
tags?: string[]
106+
/**
107+
* Optional prefix strings applied at inference
108+
* @availability stack since=8.12.0
109+
* @availability serverless
110+
*/
111+
prefix_strings?: TrainedModelPrefixStrings
105112
}
106113
}

0 commit comments

Comments
 (0)