From ea8a4bb8244d70441e1e0a4e2388e912e1b2aa35 Mon Sep 17 00:00:00 2001 From: philkra Date: Tue, 15 Feb 2022 17:26:05 +0100 Subject: [PATCH 1/6] ml.get_trained_models --- output/schema/schema.json | 319 ++++++++++++++---- output/schema/validation-errors.json | 1 - output/typescript/types.ts | 26 +- specification/_types/aggregations/pipeline.ts | 22 +- specification/ml/_types/TrainedModel.ts | 30 +- .../MlGetTrainedModelRequest.ts | 12 +- 6 files changed, 314 insertions(+), 96 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 98b2f44711..e9c0a60814 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -42401,9 +42401,9 @@ } ], "specLocation": { - "endLine": 193, + "endLine": 194, "path": "_types/aggregations/pipeline.ts", - "startLine": 178 + "startLine": 179 } }, { @@ -43458,9 +43458,9 @@ } ], "specLocation": { - "endLine": 240, + "endLine": 260, "path": "_types/aggregations/pipeline.ts", - "startLine": 238 + "startLine": 258 } }, { @@ -43497,9 +43497,9 @@ } ], "specLocation": { - "endLine": 226, + "endLine": 246, "path": "_types/aggregations/pipeline.ts", - "startLine": 223 + "startLine": 243 } }, { @@ -45221,9 +45221,9 @@ } ], "specLocation": { - "endLine": 245, + "endLine": 265, "path": "_types/aggregations/pipeline.ts", - "startLine": 242 + "startLine": 262 } }, { @@ -45260,9 +45260,9 @@ } ], "specLocation": { - "endLine": 231, + "endLine": 251, "path": "_types/aggregations/pipeline.ts", - "startLine": 228 + "startLine": 248 } }, { @@ -45340,9 +45340,9 @@ } ], "specLocation": { - "endLine": 253, + "endLine": 273, "path": "_types/aggregations/pipeline.ts", - "startLine": 246 + "startLine": 266 } }, { @@ -45379,9 +45379,9 @@ } ], "specLocation": { - "endLine": 236, + "endLine": 256, "path": "_types/aggregations/pipeline.ts", - "startLine": 233 + "startLine": 253 } }, { @@ -45401,9 +45401,9 @@ "namespace": "_types.aggregations" }, "specLocation": { - "endLine": 259, + "endLine": 279, "path": "_types/aggregations/pipeline.ts", - "startLine": 254 + "startLine": 274 } }, { @@ -45608,10 +45608,21 @@ "namespace": "_types.aggregations" } } + }, + { + "name": "ner", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "NerInferenceOptions", + "namespace": "_types.aggregations" + } + } } ], "specLocation": { - "endLine": 165, + "endLine": 166, "path": "_types/aggregations/pipeline.ts", "startLine": 160 } @@ -45986,9 +45997,9 @@ } ], "specLocation": { - "endLine": 216, + "endLine": 236, "path": "_types/aggregations/pipeline.ts", - "startLine": 213 + "startLine": 233 } }, { @@ -46448,9 +46459,9 @@ }, "properties": [], "specLocation": { - "endLine": 195, + "endLine": 215, "path": "_types/aggregations/pipeline.ts", - "startLine": 195 + "startLine": 215 } }, { @@ -46604,9 +46615,9 @@ }, "properties": [], "specLocation": { - "endLine": 197, + "endLine": 217, "path": "_types/aggregations/pipeline.ts", - "startLine": 197 + "startLine": 217 } }, { @@ -46781,9 +46792,9 @@ "namespace": "_types.aggregations" }, "specLocation": { - "endLine": 205, + "endLine": 225, "path": "_types/aggregations/pipeline.ts", - "startLine": 199 + "startLine": 219 }, "type": { "items": [ @@ -46878,9 +46889,9 @@ } ], "specLocation": { - "endLine": 211, + "endLine": 231, "path": "_types/aggregations/pipeline.ts", - "startLine": 207 + "startLine": 227 } }, { @@ -46931,9 +46942,9 @@ } ], "specLocation": { - "endLine": 265, + "endLine": 285, "path": "_types/aggregations/pipeline.ts", - "startLine": 261 + "startLine": 281 } }, { @@ -46984,9 +46995,9 @@ } ], "specLocation": { - "endLine": 271, + "endLine": 291, "path": "_types/aggregations/pipeline.ts", - "startLine": 267 + "startLine": 287 } }, { @@ -47290,6 +47301,150 @@ "startLine": 295 } }, + { + "kind": "interface", + "name": { + "name": "NerInferenceOptions", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "tokenization", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "NerInferenceTokenization", + "namespace": "_types.aggregations" + } + } + }, + { + "name": "vocabulary", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "NerInferenceVocabulary", + "namespace": "_types.aggregations" + } + } + } + ], + "specLocation": { + "endLine": 199, + "path": "_types/aggregations/pipeline.ts", + "startLine": 196 + } + }, + { + "kind": "interface", + "name": { + "name": "NerInferenceTokenization", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "bert", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "NerInferenceTokenizationBert", + "namespace": "_types.aggregations" + } + } + } + ], + "specLocation": { + "endLine": 203, + "path": "_types/aggregations/pipeline.ts", + "startLine": 201 + } + }, + { + "kind": "interface", + "name": { + "name": "NerInferenceTokenizationBert", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "do_lower_case", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "max_sequence_length", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "truncate", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "with_special_tokens", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": { + "endLine": 209, + "path": "_types/aggregations/pipeline.ts", + "startLine": 204 + } + }, + { + "kind": "interface", + "name": { + "name": "NerInferenceVocabulary", + "namespace": "_types.aggregations" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + } + ], + "specLocation": { + "endLine": 213, + "path": "_types/aggregations/pipeline.ts", + "startLine": 211 + } + }, { "attachedBehaviors": [ "AdditionalProperties" @@ -47370,9 +47525,9 @@ } ], "specLocation": { - "endLine": 275, + "endLine": 295, "path": "_types/aggregations/pipeline.ts", - "startLine": 273 + "startLine": 293 } }, { @@ -47403,9 +47558,9 @@ "namespace": "_types.aggregations" }, "specLocation": { - "endLine": 285, + "endLine": 305, "path": "_types/aggregations/pipeline.ts", - "startLine": 277 + "startLine": 297 } }, { @@ -47739,9 +47894,9 @@ } ], "specLocation": { - "endLine": 289, + "endLine": 309, "path": "_types/aggregations/pipeline.ts", - "startLine": 287 + "startLine": 307 } }, { @@ -48221,9 +48376,9 @@ } ], "specLocation": { - "endLine": 176, + "endLine": 177, "path": "_types/aggregations/pipeline.ts", - "startLine": 167 + "startLine": 168 } }, { @@ -48518,9 +48673,9 @@ } ], "specLocation": { - "endLine": 293, + "endLine": 313, "path": "_types/aggregations/pipeline.ts", - "startLine": 291 + "startLine": 311 } }, { @@ -49139,9 +49294,9 @@ } ], "specLocation": { - "endLine": 221, + "endLine": 241, "path": "_types/aggregations/pipeline.ts", - "startLine": 218 + "startLine": 238 } }, { @@ -49720,9 +49875,9 @@ }, "properties": [], "specLocation": { - "endLine": 295, + "endLine": 315, "path": "_types/aggregations/pipeline.ts", - "startLine": 295 + "startLine": 315 } }, { @@ -50129,9 +50284,9 @@ }, "properties": [], "specLocation": { - "endLine": 297, + "endLine": 317, "path": "_types/aggregations/pipeline.ts", - "startLine": 297 + "startLine": 317 } }, { @@ -129660,9 +129815,9 @@ "namespace": "ml._types" }, "specLocation": { - "endLine": 376, + "endLine": 366, "path": "ml/_types/TrainedModel.ts", - "startLine": 376 + "startLine": 366 }, "type": { "items": [ @@ -129713,7 +129868,7 @@ "namespace": "ml._types" }, "specLocation": { - "endLine": 325, + "endLine": 315, "path": "ml/_types/TrainedModel.ts", "startLine": 304 } @@ -129906,9 +130061,9 @@ } ], "specLocation": { - "endLine": 374, + "endLine": 364, "path": "ml/_types/TrainedModel.ts", - "startLine": 370 + "startLine": 360 } }, { @@ -130125,9 +130280,9 @@ } ], "specLocation": { - "endLine": 362, + "endLine": 352, "path": "ml/_types/TrainedModel.ts", - "startLine": 348 + "startLine": 338 } }, { @@ -130163,9 +130318,9 @@ } ], "specLocation": { - "endLine": 337, + "endLine": 327, "path": "ml/_types/TrainedModel.ts", - "startLine": 327 + "startLine": 317 } }, { @@ -130590,9 +130745,9 @@ } ], "specLocation": { - "endLine": 346, + "endLine": 336, "path": "ml/_types/TrainedModel.ts", - "startLine": 339 + "startLine": 329 } }, { @@ -130987,9 +131142,9 @@ } ], "specLocation": { - "endLine": 369, + "endLine": 359, "path": "ml/_types/TrainedModel.ts", - "startLine": 363 + "startLine": 353 } }, { @@ -131088,9 +131243,9 @@ } ], "specLocation": { - "endLine": 380, + "endLine": 370, "path": "ml/_types/TrainedModel.ts", - "startLine": 378 + "startLine": 368 } }, { @@ -131113,9 +131268,9 @@ } ], "specLocation": { - "endLine": 384, + "endLine": 374, "path": "ml/_types/TrainedModel.ts", - "startLine": 382 + "startLine": 372 } }, { @@ -136507,13 +136662,13 @@ }, "path": [ { - "description": "The unique identifier of the trained model.", + "description": "The unique identifier(s) of the trained model.", "name": "model_id", "required": false, "type": { "kind": "instance_of", "type": { - "name": "Id", + "name": "Ids", "namespace": "_types" } } @@ -136601,17 +136756,45 @@ "description": "A comma delimited string of tags. A trained model can have many tags, or\nnone. When supplied, only trained models that contain all the supplied\ntags are returned.", "name": "tags", "required": false, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "kind": "union_of" + } + }, + { + "description": "Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false.", + "name": "include_model_definition", + "required": false, + "since": "7.17.0", "type": { "kind": "instance_of", "type": { - "name": "string", + "name": "boolean", "namespace": "_builtins" } } } ], "specLocation": { - "endLine": 87, + "endLine": 92, "path": "ml/get_trained_models/MlGetTrainedModelRequest.ts", "startLine": 25 } diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 3a1d0b798b..4b55e593c3 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1359,7 +1359,6 @@ }, "ml.get_trained_models": { "request": [ - "Request: missing json spec query parameter 'include_model_definition'", "Request: should not have a body" ], "response": [] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 941c044b7f..4b3986cd60 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3156,6 +3156,7 @@ export interface AggregationsInferenceClassImportance { export interface AggregationsInferenceConfigContainer { regression?: AggregationsRegressionInferenceOptions classification?: AggregationsClassificationInferenceOptions + ner?: AggregationsNerInferenceOptions } export interface AggregationsInferenceFeatureImportance { @@ -3342,6 +3343,26 @@ export interface AggregationsMutualInformationHeuristic { include_negatives?: boolean } +export interface AggregationsNerInferenceOptions { + tokenization: AggregationsNerInferenceTokenization + vocabulary: AggregationsNerInferenceVocabulary +} + +export interface AggregationsNerInferenceTokenization { + bert: AggregationsNerInferenceTokenizationBert +} + +export interface AggregationsNerInferenceTokenizationBert { + do_lower_case: boolean + max_sequence_length: integer + truncate: string + with_special_tokens: boolean +} + +export interface AggregationsNerInferenceVocabulary { + index: IndexName +} + export interface AggregationsNestedAggregateKeys extends AggregationsSingleBucketAggregateBase { } export type AggregationsNestedAggregate = AggregationsNestedAggregateKeys @@ -12817,14 +12838,15 @@ export interface MlGetRecordsResponse { } export interface MlGetTrainedModelsRequest extends RequestBase { - model_id?: Id + model_id?: Ids allow_no_match?: boolean decompress_definition?: boolean exclude_generated?: boolean from?: integer include?: MlInclude size?: integer - tags?: string + tags?: string | string[] + include_model_definition?: boolean } export interface MlGetTrainedModelsResponse { diff --git a/specification/_types/aggregations/pipeline.ts b/specification/_types/aggregations/pipeline.ts index c219f64b73..f03d3c2b32 100644 --- a/specification/_types/aggregations/pipeline.ts +++ b/specification/_types/aggregations/pipeline.ts @@ -19,7 +19,7 @@ import { Sort } from '@_types/sort' import { Dictionary } from '@spec_utils/Dictionary' -import { Name, Field, EmptyObject } from '@_types/common' +import { Name, Field, EmptyObject, IndexName } from '@_types/common' import { integer, double, float } from '@_types/Numeric' import { Script } from '@_types/Scripting' import { Aggregation } from './Aggregation' @@ -162,6 +162,7 @@ export class InferenceConfigContainer { regression?: RegressionInferenceOptions /** Classification configuration for inference. */ classification?: ClassificationInferenceOptions + ner?: NerInferenceOptions } export class RegressionInferenceOptions { @@ -192,6 +193,25 @@ export class ClassificationInferenceOptions { top_classes_results_field?: string } +export class NerInferenceOptions { + tokenization: NerInferenceTokenization + vocabulary: NerInferenceVocabulary +} + +export class NerInferenceTokenization { + bert: NerInferenceTokenizationBert +} +export class NerInferenceTokenizationBert { + do_lower_case: boolean + max_sequence_length: integer + truncate: string + with_special_tokens: boolean +} + +export class NerInferenceVocabulary { + index: IndexName +} + export class MaxBucketAggregation extends PipelineAggregationBase {} export class MinBucketAggregation extends PipelineAggregationBase {} diff --git a/specification/ml/_types/TrainedModel.ts b/specification/ml/_types/TrainedModel.ts index 7b0c636251..4b293e152f 100644 --- a/specification/ml/_types/TrainedModel.ts +++ b/specification/ml/_types/TrainedModel.ts @@ -302,26 +302,16 @@ export class TrainedModelAllocationTaskParameters { } export enum RoutingState { - /** - * The allocation attempt failed. - */ - failed = 0, - /** - * The trained model is allocated and ready to accept inference requests. - */ - started = 1, - /** - * The trained model is attempting to allocate on this node; inference requests are not yet accepted. - */ - starting = 2, - /** - * The trained model is fully deallocated from this node. - */ - stopped = 3, - /** - * The trained model is being deallocated from this node. - */ - stopping = 4 + /** The allocation attempt failed. */ + failed, + /** The trained model is allocated and ready to accept inference requests. */ + started, + /** The trained model is attempting to allocate on this node; inference requests are not yet accepted. */ + starting, + /** The trained model is fully deallocated from this node. */ + stopped, + /** The trained model is being deallocated from this node. */ + stopping } export class TrainedModelAllocationRoutingTable { diff --git a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts index f0c4e72861..13c7876369 100644 --- a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts +++ b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts @@ -18,7 +18,7 @@ */ import { RequestBase } from '@_types/Base' -import { Id } from '@_types/common' +import { Ids } from '@_types/common' import { integer } from '@_types/Numeric' import { Include } from '@ml/_types/Include' @@ -32,9 +32,9 @@ import { Include } from '@ml/_types/Include' export interface Request extends RequestBase { path_parts: { /** - * The unique identifier of the trained model. + * The unique identifier(s) of the trained model. */ - model_id?: Id + model_id?: Ids } query_parameters: { /** @@ -82,6 +82,10 @@ export interface Request extends RequestBase { * none. When supplied, only trained models that contain all the supplied * tags are returned. */ - tags?: string + tags?: string | string[] + /** + * @since 7.17.0 + */ + include_model_definition?: boolean } } From 60fc3566ca79bc50a73344e4695ea09617bf4faa Mon Sep 17 00:00:00 2001 From: philkra Date: Tue, 15 Feb 2022 17:30:00 +0100 Subject: [PATCH 2/6] fresh contrib --- output/schema/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index b66078d899..4454fd408c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -136828,7 +136828,7 @@ } ], "specLocation": { - "endLine": 92, + "endLine": 91, "path": "ml/get_trained_models/MlGetTrainedModelRequest.ts", "startLine": 25 } From 8c65c29c16ea4edb9c6faae354b04305543f9895 Mon Sep 17 00:00:00 2001 From: Philip Krauss <35487337+philkra@users.noreply.github.com> Date: Wed, 16 Feb 2022 09:01:39 +0100 Subject: [PATCH 3/6] Update specification/ml/get_trained_models/MlGetTrainedModelRequest.ts Co-authored-by: Lisa Cawley --- .../ml/get_trained_models/MlGetTrainedModelRequest.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts index 13c7876369..448d8afacb 100644 --- a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts +++ b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts @@ -84,7 +84,8 @@ export interface Request extends RequestBase { */ tags?: string | string[] /** - * @since 7.17.0 + * @since 7.13.0 + * @deprecated 7.13.0 */ include_model_definition?: boolean } From 0eb06dc7a9c946357c663d6fc19f797c43711901 Mon Sep 17 00:00:00 2001 From: Philip Krauss <35487337+philkra@users.noreply.github.com> Date: Wed, 16 Feb 2022 09:01:46 +0100 Subject: [PATCH 4/6] Update specification/ml/get_trained_models/MlGetTrainedModelRequest.ts Co-authored-by: Lisa Cawley --- specification/ml/get_trained_models/MlGetTrainedModelRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts index 448d8afacb..98d068ad1e 100644 --- a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts +++ b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts @@ -32,7 +32,7 @@ import { Include } from '@ml/_types/Include' export interface Request extends RequestBase { path_parts: { /** - * The unique identifier(s) of the trained model. + * The unique identifiers of the trained model. */ model_id?: Ids } From 075fdc9ebbd1324ffef2a2cec08703c5509e03ef Mon Sep 17 00:00:00 2001 From: Philip Krauss <35487337+philkra@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:24:07 +0100 Subject: [PATCH 5/6] Update specification/ml/get_trained_models/MlGetTrainedModelRequest.ts Co-authored-by: David Kyle --- specification/ml/get_trained_models/MlGetTrainedModelRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts index 98d068ad1e..b71b73cc00 100644 --- a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts +++ b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts @@ -85,7 +85,7 @@ export interface Request extends RequestBase { tags?: string | string[] /** * @since 7.13.0 - * @deprecated 7.13.0 + * @deprecated 7.10.0 */ include_model_definition?: boolean } From fc23346ce51af48e22d5ca4ec30f40e4d6f7e820 Mon Sep 17 00:00:00 2001 From: Philip Krauss <35487337+philkra@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:24:13 +0100 Subject: [PATCH 6/6] Update specification/ml/get_trained_models/MlGetTrainedModelRequest.ts Co-authored-by: David Kyle --- specification/ml/get_trained_models/MlGetTrainedModelRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts index b71b73cc00..7a8ce1eebd 100644 --- a/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts +++ b/specification/ml/get_trained_models/MlGetTrainedModelRequest.ts @@ -84,7 +84,7 @@ export interface Request extends RequestBase { */ tags?: string | string[] /** - * @since 7.13.0 + * @since 7.6.0 * @deprecated 7.10.0 */ include_model_definition?: boolean