From db8c8727a32fef044dec443eacbe813ed83fc0e4 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:58:55 +0100 Subject: [PATCH] fixing inference trained models (#4095) Co-authored-by: Quentin Pradet (cherry picked from commit eeb1afbe4e6897f5387e56ce9b2f54310d391e62) --- output/openapi/elasticsearch-openapi.json | 122 +++++-- .../elasticsearch-serverless-openapi.json | 122 +++++-- output/schema/schema-serverless.json | 300 ++++++++++++++---- output/schema/schema.json | 294 +++++++++++++---- output/typescript/types.ts | 23 +- specification/inference/_types/Services.ts | 2 +- specification/ml/_types/TrainedModel.ts | 1 + specification/ml/_types/inference.ts | 33 +- 8 files changed, 717 insertions(+), 180 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 86e731e5a7..d23f7e9c9b 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -78076,32 +78076,25 @@ ] }, "inference._types:InferenceChunkingSettings": { - "allOf": [ - { - "$ref": "#/components/schemas/inference._types:InferenceEndpoint" + "type": "object", + "properties": { + "max_chunk_size": { + "description": "The maximum size of a chunk in words.\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).", + "type": "number" }, - { - "type": "object", - "properties": { - "max_chunk_size": { - "description": "The maximum size of a chunk in words.\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).", - "type": "number" - }, - "overlap": { - "description": "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.", - "type": "number" - }, - "sentence_overlap": { - "description": "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.", - "type": "number" - }, - "strategy": { - "description": "The chunking strategy: `sentence` or `word`.", - "type": "string" - } - } + "overlap": { + "description": "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.", + "type": "number" + }, + "sentence_overlap": { + "description": "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.", + "type": "number" + }, + "strategy": { + "description": "The chunking strategy: `sentence` or `word`.", + "type": "string" } - ] + } }, "inference._types:ServiceSettings": { "type": "object" @@ -85237,6 +85230,9 @@ "location": { "$ref": "#/components/schemas/ml._types:TrainedModelLocation" }, + "platform_architecture": { + "type": "string" + }, "prefix_strings": { "$ref": "#/components/schemas/ml._types:TrainedModelPrefixStrings" } @@ -85274,6 +85270,9 @@ "fill_mask": { "$ref": "#/components/schemas/ml._types:FillMaskInferenceOptions" }, + "learning_to_rank": { + "$ref": "#/components/schemas/ml._types:LearningToRankConfig" + }, "ner": { "$ref": "#/components/schemas/ml._types:NerInferenceOptions" }, @@ -85313,6 +85312,9 @@ "items": { "type": "string" } + }, + "vocabulary": { + "$ref": "#/components/schemas/ml._types:Vocabulary" } } }, @@ -85331,6 +85333,9 @@ }, "roberta": { "$ref": "#/components/schemas/ml._types:NlpRobertaTokenizationConfig" + }, + "xlm_roberta": { + "$ref": "#/components/schemas/ml._types:XlmRobertaTokenizationConfig" } }, "minProperties": 1, @@ -85394,6 +85399,27 @@ } ] }, + "ml._types:XlmRobertaTokenizationConfig": { + "allOf": [ + { + "$ref": "#/components/schemas/ml._types:CommonTokenizationConfig" + }, + { + "type": "object" + } + ] + }, + "ml._types:Vocabulary": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types:IndexName" + } + }, + "required": [ + "index" + ] + }, "ml._types:ZeroShotClassificationInferenceOptions": { "type": "object", "properties": { @@ -85457,15 +85483,55 @@ "vocabulary" ] }, - "ml._types:Vocabulary": { + "ml._types:LearningToRankConfig": { "type": "object", "properties": { - "index": { - "$ref": "#/components/schemas/_types:IndexName" + "default_params": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "feature_extractors": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ml._types:FeatureExtractor" + } + } + }, + "num_top_feature_importance_values": { + "type": "number" } }, "required": [ - "index" + "num_top_feature_importance_values" + ] + }, + "ml._types:FeatureExtractor": { + "allOf": [ + { + "$ref": "#/components/schemas/ml._types:QueryFeatureExtractor" + } + ] + }, + "ml._types:QueryFeatureExtractor": { + "type": "object", + "properties": { + "default_score": { + "type": "number" + }, + "feature_name": { + "type": "string" + }, + "query": { + "$ref": "#/components/schemas/_types.query_dsl:QueryContainer" + } + }, + "required": [ + "feature_name", + "query" ] }, "ml._types:NerInferenceOptions": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 16140a7f3e..19e01d82de 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -49406,32 +49406,25 @@ ] }, "inference._types:InferenceChunkingSettings": { - "allOf": [ - { - "$ref": "#/components/schemas/inference._types:InferenceEndpoint" + "type": "object", + "properties": { + "max_chunk_size": { + "description": "The maximum size of a chunk in words.\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).", + "type": "number" }, - { - "type": "object", - "properties": { - "max_chunk_size": { - "description": "The maximum size of a chunk in words.\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy).", - "type": "number" - }, - "overlap": { - "description": "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.", - "type": "number" - }, - "sentence_overlap": { - "description": "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.", - "type": "number" - }, - "strategy": { - "description": "The chunking strategy: `sentence` or `word`.", - "type": "string" - } - } + "overlap": { + "description": "The number of overlapping words for chunks.\nIt is applicable only to a `word` chunking strategy.\nThis value cannot be higher than half the `max_chunk_size` value.", + "type": "number" + }, + "sentence_overlap": { + "description": "The number of overlapping sentences for chunks.\nIt is applicable only for a `sentence` chunking strategy.\nIt can be either `1` or `0`.", + "type": "number" + }, + "strategy": { + "description": "The chunking strategy: `sentence` or `word`.", + "type": "string" } - ] + } }, "inference._types:ServiceSettings": { "type": "object" @@ -55252,6 +55245,9 @@ "location": { "$ref": "#/components/schemas/ml._types:TrainedModelLocation" }, + "platform_architecture": { + "type": "string" + }, "prefix_strings": { "$ref": "#/components/schemas/ml._types:TrainedModelPrefixStrings" } @@ -55289,6 +55285,9 @@ "fill_mask": { "$ref": "#/components/schemas/ml._types:FillMaskInferenceOptions" }, + "learning_to_rank": { + "$ref": "#/components/schemas/ml._types:LearningToRankConfig" + }, "ner": { "$ref": "#/components/schemas/ml._types:NerInferenceOptions" }, @@ -55328,6 +55327,9 @@ "items": { "type": "string" } + }, + "vocabulary": { + "$ref": "#/components/schemas/ml._types:Vocabulary" } } }, @@ -55346,6 +55348,9 @@ }, "roberta": { "$ref": "#/components/schemas/ml._types:NlpRobertaTokenizationConfig" + }, + "xlm_roberta": { + "$ref": "#/components/schemas/ml._types:XlmRobertaTokenizationConfig" } }, "minProperties": 1, @@ -55409,6 +55414,27 @@ } ] }, + "ml._types:XlmRobertaTokenizationConfig": { + "allOf": [ + { + "$ref": "#/components/schemas/ml._types:CommonTokenizationConfig" + }, + { + "type": "object" + } + ] + }, + "ml._types:Vocabulary": { + "type": "object", + "properties": { + "index": { + "$ref": "#/components/schemas/_types:IndexName" + } + }, + "required": [ + "index" + ] + }, "ml._types:ZeroShotClassificationInferenceOptions": { "type": "object", "properties": { @@ -55472,15 +55498,55 @@ "vocabulary" ] }, - "ml._types:Vocabulary": { + "ml._types:LearningToRankConfig": { "type": "object", "properties": { - "index": { - "$ref": "#/components/schemas/_types:IndexName" + "default_params": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "feature_extractors": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ml._types:FeatureExtractor" + } + } + }, + "num_top_feature_importance_values": { + "type": "number" } }, "required": [ - "index" + "num_top_feature_importance_values" + ] + }, + "ml._types:FeatureExtractor": { + "allOf": [ + { + "$ref": "#/components/schemas/ml._types:QueryFeatureExtractor" + } + ] + }, + "ml._types:QueryFeatureExtractor": { + "type": "object", + "properties": { + "default_score": { + "type": "number" + }, + "feature_name": { + "type": "string" + }, + "query": { + "$ref": "#/components/schemas/_types.query_dsl:QueryContainer" + } + }, + "required": [ + "feature_name", + "query" ] }, "ml._types:NerInferenceOptions": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 40c1a20209..1d02dd3795 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -69621,7 +69621,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L82-L91" + "specLocation": "ml/_types/inference.ts#L107-L116" }, { "kind": "interface", @@ -69694,7 +69694,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L93-L108" + "specLocation": "ml/_types/inference.ts#L118-L133" }, { "inherits": { @@ -103774,7 +103774,7 @@ "name": "DeploymentAllocationState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L330-L343" + "specLocation": "ml/_types/TrainedModel.ts#L331-L344" }, { "kind": "enum", @@ -103800,7 +103800,7 @@ "name": "DeploymentAssignmentState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L345-L362" + "specLocation": "ml/_types/TrainedModel.ts#L346-L363" }, { "kind": "type_alias", @@ -103973,6 +103973,65 @@ }, "specLocation": "ml/_types/Detector.ts#L145-L150" }, + { + "kind": "type_alias", + "name": { + "name": "FeatureExtractor", + "namespace": "ml._types" + }, + "specLocation": "ml/_types/inference.ts#L93-L96", + "type": { + "kind": "instance_of", + "type": { + "name": "QueryFeatureExtractor", + "namespace": "ml._types" + } + } + }, + { + "kind": "interface", + "name": { + "name": "QueryFeatureExtractor", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "default_score", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "name": "feature_name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "query", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" + } + } + } + ], + "specLocation": "ml/_types/inference.ts#L98-L105", + "variantName": "query_extractor" + }, { "kind": "enum", "members": [ @@ -104093,7 +104152,7 @@ "name": "PredictedValue", "namespace": "ml._types" }, - "specLocation": "ml/_types/inference.ts#L445-L445", + "specLocation": "ml/_types/inference.ts#L476-L476", "type": { "items": [ { @@ -104145,7 +104204,7 @@ "name": "RoutingState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L407-L428" + "specLocation": "ml/_types/TrainedModel.ts#L408-L429" }, { "kind": "enum", @@ -104204,7 +104263,7 @@ "name": "TokenizationTruncate", "namespace": "ml._types" }, - "specLocation": "ml/_types/inference.ts#L338-L342" + "specLocation": "ml/_types/inference.ts#L369-L373" }, { "kind": "enum", @@ -104226,7 +104285,7 @@ "name": "TrainedModelType", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L314-L328" + "specLocation": "ml/_types/TrainedModel.ts#L315-L329" }, { "kind": "enum", @@ -104242,7 +104301,7 @@ "name": "TrainingPriority", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L364-L367" + "specLocation": "ml/_types/TrainedModel.ts#L365-L368" }, { "kind": "enum", @@ -123635,12 +123694,6 @@ }, { "description": "Chunking configuration object", - "inherits": { - "type": { - "name": "InferenceEndpoint", - "namespace": "inference._types" - } - }, "kind": "interface", "name": { "name": "InferenceChunkingSettings", @@ -137319,6 +137372,17 @@ } } }, + { + "name": "platform_architecture", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "name": "prefix_strings", "required": false, @@ -137331,7 +137395,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L203-L239" + "specLocation": "ml/_types/TrainedModel.ts#L203-L240" }, { "description": "Inference configuration provided when storing the model config", @@ -137419,6 +137483,17 @@ } } }, + { + "name": "learning_to_rank", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "LearningToRankConfig", + "namespace": "ml._types" + } + } + }, { "availability": { "serverless": {}, @@ -137510,7 +137585,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L23-L80", + "specLocation": "ml/_types/inference.ts#L26-L85", "variants": { "kind": "container" } @@ -137573,9 +137648,20 @@ } } } + }, + { + "name": "vocabulary", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Vocabulary", + "namespace": "ml._types" + } + } } ], - "specLocation": "ml/_types/inference.ts#L173-L183" + "specLocation": "ml/_types/inference.ts#L202-L214" }, { "description": "Tokenization options stored in inference configuration", @@ -137644,9 +137730,20 @@ "namespace": "ml._types" } } + }, + { + "name": "xlm_roberta", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "XlmRobertaTokenizationConfig", + "namespace": "ml._types" + } + } } ], - "specLocation": "ml/_types/inference.ts#L110-L131", + "specLocation": "ml/_types/inference.ts#L135-L158", "variants": { "kind": "container" } @@ -137665,7 +137762,7 @@ "namespace": "ml._types" }, "properties": [], - "specLocation": "ml/_types/inference.ts#L161-L162" + "specLocation": "ml/_types/inference.ts#L188-L189" }, { "kind": "interface", @@ -137740,7 +137837,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L133-L159" + "specLocation": "ml/_types/inference.ts#L160-L186" }, { "description": "RoBERTa tokenization configuration options", @@ -137770,7 +137867,43 @@ } } ], - "specLocation": "ml/_types/inference.ts#L164-L171" + "specLocation": "ml/_types/inference.ts#L191-L198" + }, + { + "inherits": { + "type": { + "name": "CommonTokenizationConfig", + "namespace": "ml._types" + } + }, + "kind": "interface", + "name": { + "name": "XlmRobertaTokenizationConfig", + "namespace": "ml._types" + }, + "properties": [], + "specLocation": "ml/_types/inference.ts#L200-L200" + }, + { + "kind": "interface", + "name": { + "name": "Vocabulary", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + } + ], + "specLocation": "ml/_types/inference.ts#L248-L250" }, { "description": "Zero shot classification configuration options", @@ -137861,7 +137994,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L185-L206" + "specLocation": "ml/_types/inference.ts#L216-L237" }, { "description": "Fill mask inference options", @@ -137931,28 +138064,71 @@ } } ], - "specLocation": "ml/_types/inference.ts#L253-L268" + "specLocation": "ml/_types/inference.ts#L284-L299" }, { "kind": "interface", "name": { - "name": "Vocabulary", + "name": "LearningToRankConfig", "namespace": "ml._types" }, "properties": [ { - "name": "index", + "name": "default_params", + "required": false, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + }, + { + "name": "feature_extractors", + "required": false, + "type": { + "kind": "array_of", + "value": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "FeatureExtractor", + "namespace": "ml._types" + } + } + } + } + }, + { + "name": "num_top_feature_importance_values", "required": true, "type": { "kind": "instance_of", "type": { - "name": "IndexName", + "name": "integer", "namespace": "_types" } } } ], - "specLocation": "ml/_types/inference.ts#L217-L219" + "specLocation": "ml/_types/inference.ts#L87-L91" }, { "description": "Named entity recognition options", @@ -138013,7 +138189,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L242-L251" + "specLocation": "ml/_types/inference.ts#L273-L282" }, { "description": "Pass through configuration options", @@ -138059,7 +138235,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L208-L215" + "specLocation": "ml/_types/inference.ts#L239-L246" }, { "description": "Text embedding inference options", @@ -138117,7 +138293,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L221-L231" + "specLocation": "ml/_types/inference.ts#L252-L262" }, { "description": "Text expansion inference options", @@ -138163,7 +138339,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L233-L240" + "specLocation": "ml/_types/inference.ts#L264-L271" }, { "description": "Question answering inference options", @@ -138222,7 +138398,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L270-L280" + "specLocation": "ml/_types/inference.ts#L301-L311" }, { "kind": "interface", @@ -138247,7 +138423,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L241-L244" + "specLocation": "ml/_types/TrainedModel.ts#L242-L245" }, { "kind": "interface", @@ -138324,7 +138500,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L246-L254" + "specLocation": "ml/_types/TrainedModel.ts#L247-L255" }, { "kind": "interface", @@ -138396,7 +138572,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L273-L287" + "specLocation": "ml/_types/TrainedModel.ts#L274-L288" }, { "kind": "interface", @@ -138448,7 +138624,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L289-L296" + "specLocation": "ml/_types/TrainedModel.ts#L290-L297" }, { "kind": "interface", @@ -138494,7 +138670,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L305-L312" + "specLocation": "ml/_types/TrainedModel.ts#L306-L313" }, { "kind": "interface", @@ -138531,7 +138707,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L298-L303" + "specLocation": "ml/_types/TrainedModel.ts#L299-L304" }, { "kind": "interface", @@ -138714,7 +138890,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L256-L271" + "specLocation": "ml/_types/TrainedModel.ts#L257-L272" }, { "kind": "interface", @@ -138748,7 +138924,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L486-L495" + "specLocation": "ml/_types/TrainedModel.ts#L487-L496" }, { "kind": "interface", @@ -138769,7 +138945,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L478-L480" + "specLocation": "ml/_types/TrainedModel.ts#L479-L481" }, { "kind": "interface", @@ -138790,7 +138966,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L482-L484" + "specLocation": "ml/_types/TrainedModel.ts#L483-L485" }, { "kind": "interface", @@ -139207,7 +139383,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L450-L457" + "specLocation": "ml/_types/TrainedModel.ts#L451-L458" }, { "kind": "interface", @@ -139519,7 +139695,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L430-L448" + "specLocation": "ml/_types/TrainedModel.ts#L431-L449" }, { "kind": "interface", @@ -139764,7 +139940,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L284-L306", + "specLocation": "ml/_types/inference.ts#L315-L337", "variants": { "kind": "container" } @@ -139828,7 +140004,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L351-L360" + "specLocation": "ml/_types/inference.ts#L382-L391" }, { "kind": "interface", @@ -139862,7 +140038,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L344-L349" + "specLocation": "ml/_types/inference.ts#L375-L380" }, { "kind": "interface", @@ -139923,7 +140099,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L362-L371" + "specLocation": "ml/_types/inference.ts#L393-L402" }, { "kind": "interface", @@ -139969,7 +140145,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L399-L406" + "specLocation": "ml/_types/inference.ts#L430-L437" }, { "kind": "interface", @@ -140003,7 +140179,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L392-L397" + "specLocation": "ml/_types/inference.ts#L423-L428" }, { "kind": "interface", @@ -140037,7 +140213,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L373-L378" + "specLocation": "ml/_types/inference.ts#L404-L409" }, { "kind": "interface", @@ -140070,7 +140246,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L380-L384" + "specLocation": "ml/_types/inference.ts#L411-L415" }, { "kind": "interface", @@ -140103,7 +140279,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L386-L390" + "specLocation": "ml/_types/inference.ts#L417-L421" }, { "kind": "interface", @@ -140173,7 +140349,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L408-L419" + "specLocation": "ml/_types/inference.ts#L439-L450" }, { "kind": "interface", @@ -140315,7 +140491,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L447-L495" + "specLocation": "ml/_types/inference.ts#L478-L526" }, { "kind": "interface", @@ -140380,7 +140556,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L421-L427" + "specLocation": "ml/_types/inference.ts#L452-L458" }, { "kind": "interface", @@ -140423,7 +140599,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L428-L432" + "specLocation": "ml/_types/inference.ts#L459-L463" }, { "kind": "interface", @@ -140469,7 +140645,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L439-L443" + "specLocation": "ml/_types/inference.ts#L470-L474" }, { "kind": "interface", @@ -140501,7 +140677,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L434-L437" + "specLocation": "ml/_types/inference.ts#L465-L468" }, { "kind": "interface", @@ -142086,7 +142262,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L459-L476" + "specLocation": "ml/_types/TrainedModel.ts#L460-L477" }, { "kind": "interface", @@ -142219,7 +142395,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L369-L405" + "specLocation": "ml/_types/TrainedModel.ts#L370-L406" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index 69795b0efc..2d6a186fa7 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -149533,12 +149533,6 @@ { "kind": "interface", "description": "Chunking configuration object", - "inherits": { - "type": { - "name": "InferenceEndpoint", - "namespace": "inference._types" - } - }, "name": { "name": "InferenceChunkingSettings", "namespace": "inference._types" @@ -166627,7 +166621,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L93-L108" + "specLocation": "ml/_types/inference.ts#L118-L133" }, { "kind": "interface", @@ -166702,7 +166696,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L133-L159" + "specLocation": "ml/_types/inference.ts#L160-L186" }, { "kind": "enum", @@ -170046,7 +170040,7 @@ "name": "DeploymentAllocationState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L330-L343" + "specLocation": "ml/_types/TrainedModel.ts#L331-L344" }, { "kind": "enum", @@ -170072,7 +170066,7 @@ "name": "DeploymentAssignmentState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L345-L362" + "specLocation": "ml/_types/TrainedModel.ts#L346-L363" }, { "kind": "interface", @@ -170797,6 +170791,21 @@ ], "specLocation": "ml/_types/Datafeed.ts#L204-L208" }, + { + "kind": "type_alias", + "name": { + "name": "FeatureExtractor", + "namespace": "ml._types" + }, + "specLocation": "ml/_types/inference.ts#L93-L96", + "type": { + "kind": "instance_of", + "type": { + "name": "QueryFeatureExtractor", + "namespace": "ml._types" + } + } + }, { "kind": "interface", "description": "Fill mask inference options", @@ -170865,7 +170874,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L253-L268" + "specLocation": "ml/_types/inference.ts#L284-L299" }, { "kind": "interface", @@ -170911,7 +170920,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L399-L406" + "specLocation": "ml/_types/inference.ts#L430-L437" }, { "kind": "interface", @@ -171117,7 +171126,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L273-L287" + "specLocation": "ml/_types/TrainedModel.ts#L274-L288" }, { "kind": "interface", @@ -171413,6 +171422,17 @@ } } }, + { + "name": "learning_to_rank", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "LearningToRankConfig", + "namespace": "ml._types" + } + } + }, { "availability": { "serverless": {}, @@ -171504,7 +171524,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L23-L80", + "specLocation": "ml/_types/inference.ts#L26-L85", "variants": { "kind": "container" } @@ -171637,7 +171657,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L284-L306", + "specLocation": "ml/_types/inference.ts#L315-L337", "variants": { "kind": "container" } @@ -171782,7 +171802,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L447-L495" + "specLocation": "ml/_types/inference.ts#L478-L526" }, { "kind": "interface", @@ -172996,6 +173016,70 @@ ], "specLocation": "ml/_types/Job.ts#L332-L341" }, + { + "kind": "interface", + "name": { + "name": "LearningToRankConfig", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "default_params", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + }, + { + "name": "feature_extractors", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "FeatureExtractor", + "namespace": "ml._types" + } + } + } + } + }, + { + "name": "num_top_feature_importance_values", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + } + ], + "specLocation": "ml/_types/inference.ts#L87-L91" + }, { "kind": "enum", "members": [ @@ -173196,7 +173280,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L256-L271" + "specLocation": "ml/_types/TrainedModel.ts#L257-L272" }, { "kind": "interface", @@ -173767,7 +173851,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L242-L251" + "specLocation": "ml/_types/inference.ts#L273-L282" }, { "kind": "interface", @@ -173801,7 +173885,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L392-L397" + "specLocation": "ml/_types/inference.ts#L423-L428" }, { "kind": "interface", @@ -173817,7 +173901,7 @@ "namespace": "ml._types" }, "properties": [], - "specLocation": "ml/_types/inference.ts#L161-L162" + "specLocation": "ml/_types/inference.ts#L188-L189" }, { "kind": "interface", @@ -173847,7 +173931,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L164-L171" + "specLocation": "ml/_types/inference.ts#L191-L198" }, { "kind": "interface", @@ -173881,7 +173965,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L344-L349" + "specLocation": "ml/_types/inference.ts#L375-L380" }, { "kind": "interface", @@ -174195,7 +174279,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L208-L215" + "specLocation": "ml/_types/inference.ts#L239-L246" }, { "kind": "interface", @@ -174229,7 +174313,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L373-L378" + "specLocation": "ml/_types/inference.ts#L404-L409" }, { "kind": "interface", @@ -174271,7 +174355,7 @@ "name": "PredictedValue", "namespace": "ml._types" }, - "specLocation": "ml/_types/inference.ts#L445-L445", + "specLocation": "ml/_types/inference.ts#L476-L476", "type": { "kind": "union_of", "items": [ @@ -174295,6 +174379,50 @@ ] } }, + { + "kind": "interface", + "name": { + "name": "QueryFeatureExtractor", + "namespace": "ml._types" + }, + "properties": [ + { + "name": "default_score", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "float", + "namespace": "_types" + } + } + }, + { + "name": "feature_name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "query", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "QueryContainer", + "namespace": "_types.query_dsl" + } + } + } + ], + "specLocation": "ml/_types/inference.ts#L98-L105", + "variantName": "query_extractor" + }, { "kind": "interface", "description": "Question answering inference options", @@ -174352,7 +174480,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L270-L280" + "specLocation": "ml/_types/inference.ts#L301-L311" }, { "kind": "interface", @@ -174422,7 +174550,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L408-L419" + "specLocation": "ml/_types/inference.ts#L439-L450" }, { "kind": "interface", @@ -174459,7 +174587,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L82-L91" + "specLocation": "ml/_types/inference.ts#L107-L116" }, { "kind": "enum", @@ -174489,7 +174617,7 @@ "name": "RoutingState", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L407-L428" + "specLocation": "ml/_types/TrainedModel.ts#L408-L429" }, { "kind": "enum", @@ -174711,9 +174839,20 @@ } } } + }, + { + "name": "vocabulary", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Vocabulary", + "namespace": "ml._types" + } + } } ], - "specLocation": "ml/_types/inference.ts#L173-L183" + "specLocation": "ml/_types/inference.ts#L202-L214" }, { "kind": "interface", @@ -174774,7 +174913,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L351-L360" + "specLocation": "ml/_types/inference.ts#L382-L391" }, { "kind": "interface", @@ -174832,7 +174971,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L221-L231" + "specLocation": "ml/_types/inference.ts#L252-L262" }, { "kind": "interface", @@ -174865,7 +175004,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L380-L384" + "specLocation": "ml/_types/inference.ts#L411-L415" }, { "kind": "interface", @@ -174911,7 +175050,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L233-L240" + "specLocation": "ml/_types/inference.ts#L264-L271" }, { "kind": "interface", @@ -174944,7 +175083,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L386-L390" + "specLocation": "ml/_types/inference.ts#L417-L421" }, { "kind": "interface", @@ -175065,9 +175204,20 @@ "namespace": "ml._types" } } + }, + { + "name": "xlm_roberta", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "XlmRobertaTokenizationConfig", + "namespace": "ml._types" + } + } } ], - "specLocation": "ml/_types/inference.ts#L110-L131", + "specLocation": "ml/_types/inference.ts#L135-L158", "variants": { "kind": "container" } @@ -175089,7 +175239,7 @@ "name": "TokenizationTruncate", "namespace": "ml._types" }, - "specLocation": "ml/_types/inference.ts#L338-L342" + "specLocation": "ml/_types/inference.ts#L369-L373" }, { "kind": "interface", @@ -175132,7 +175282,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L428-L432" + "specLocation": "ml/_types/inference.ts#L459-L463" }, { "kind": "interface", @@ -175184,7 +175334,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L289-L296" + "specLocation": "ml/_types/TrainedModel.ts#L290-L297" }, { "kind": "interface", @@ -175221,7 +175371,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L298-L303" + "specLocation": "ml/_types/TrainedModel.ts#L299-L304" }, { "kind": "interface", @@ -175267,7 +175417,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L305-L312" + "specLocation": "ml/_types/TrainedModel.ts#L306-L313" }, { "kind": "interface", @@ -175380,7 +175530,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L459-L476" + "specLocation": "ml/_types/TrainedModel.ts#L460-L477" }, { "kind": "interface", @@ -175438,7 +175588,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L430-L448" + "specLocation": "ml/_types/TrainedModel.ts#L431-L449" }, { "kind": "interface", @@ -175571,7 +175721,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L369-L405" + "specLocation": "ml/_types/TrainedModel.ts#L370-L406" }, { "kind": "interface", @@ -175818,6 +175968,17 @@ } } }, + { + "name": "platform_architecture", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "name": "prefix_strings", "required": false, @@ -175830,7 +175991,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L203-L239" + "specLocation": "ml/_types/TrainedModel.ts#L203-L240" }, { "kind": "interface", @@ -175855,7 +176016,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L241-L244" + "specLocation": "ml/_types/TrainedModel.ts#L242-L245" }, { "kind": "interface", @@ -175932,7 +176093,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L246-L254" + "specLocation": "ml/_types/TrainedModel.ts#L247-L255" }, { "kind": "interface", @@ -175978,7 +176139,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L450-L457" + "specLocation": "ml/_types/TrainedModel.ts#L451-L458" }, { "kind": "interface", @@ -176546,7 +176707,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L421-L427" + "specLocation": "ml/_types/inference.ts#L452-L458" }, { "kind": "interface", @@ -176578,7 +176739,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L434-L437" + "specLocation": "ml/_types/inference.ts#L465-L468" }, { "kind": "interface", @@ -176624,7 +176785,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L439-L443" + "specLocation": "ml/_types/inference.ts#L470-L474" }, { "kind": "interface", @@ -176726,7 +176887,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L478-L480" + "specLocation": "ml/_types/TrainedModel.ts#L479-L481" }, { "kind": "interface", @@ -176747,7 +176908,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L482-L484" + "specLocation": "ml/_types/TrainedModel.ts#L483-L485" }, { "kind": "interface", @@ -176781,7 +176942,7 @@ } } ], - "specLocation": "ml/_types/TrainedModel.ts#L486-L495" + "specLocation": "ml/_types/TrainedModel.ts#L487-L496" }, { "kind": "interface", @@ -176928,7 +177089,7 @@ "name": "TrainedModelType", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L314-L328" + "specLocation": "ml/_types/TrainedModel.ts#L315-L329" }, { "kind": "enum", @@ -176944,7 +177105,7 @@ "name": "TrainingPriority", "namespace": "ml._types" }, - "specLocation": "ml/_types/TrainedModel.ts#L364-L367" + "specLocation": "ml/_types/TrainedModel.ts#L365-L368" }, { "kind": "interface", @@ -177051,7 +177212,22 @@ } } ], - "specLocation": "ml/_types/inference.ts#L217-L219" + "specLocation": "ml/_types/inference.ts#L248-L250" + }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "CommonTokenizationConfig", + "namespace": "ml._types" + } + }, + "name": { + "name": "XlmRobertaTokenizationConfig", + "namespace": "ml._types" + }, + "properties": [], + "specLocation": "ml/_types/inference.ts#L200-L200" }, { "kind": "interface", @@ -177142,7 +177318,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L185-L206" + "specLocation": "ml/_types/inference.ts#L216-L237" }, { "kind": "interface", @@ -177203,7 +177379,7 @@ } } ], - "specLocation": "ml/_types/inference.ts#L362-L371" + "specLocation": "ml/_types/inference.ts#L393-L402" }, { "kind": "request", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b68f45b692..c7f14ab89f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13078,7 +13078,7 @@ export type InferenceDenseByteVector = byte[] export type InferenceDenseVector = float[] -export interface InferenceInferenceChunkingSettings extends InferenceInferenceEndpoint { +export interface InferenceInferenceChunkingSettings { max_chunk_size?: integer overlap?: integer sentence_overlap?: integer @@ -15303,6 +15303,8 @@ export interface MlExponentialAverageCalculationContext { previous_exponential_average_ms?: DurationValue } +export type MlFeatureExtractor = MlQueryFeatureExtractor + export interface MlFillMaskInferenceOptions { mask_token?: string num_top_classes?: integer @@ -15368,6 +15370,7 @@ export interface MlInferenceConfigCreateContainer { text_classification?: MlTextClassificationInferenceOptions zero_shot_classification?: MlZeroShotClassificationInferenceOptions fill_mask?: MlFillMaskInferenceOptions + learning_to_rank?: MlLearningToRankConfig ner?: MlNerInferenceOptions pass_through?: MlPassThroughInferenceOptions text_embedding?: MlTextEmbeddingInferenceOptions @@ -15514,6 +15517,12 @@ export interface MlJobTimingStats { minimum_bucket_processing_time_ms?: DurationValue } +export interface MlLearningToRankConfig { + default_params?: Record + feature_extractors?: Record[] + num_top_feature_importance_values: integer +} + export type MlMemoryStatus = 'ok' | 'soft_limit' | 'hard_limit' export interface MlModelPackageConfig { @@ -15656,6 +15665,12 @@ export interface MlPerPartitionCategorization { export type MlPredictedValue = ScalarValue | ScalarValue[] +export interface MlQueryFeatureExtractor { + default_score?: float + feature_name: string + query: QueryDslQueryContainer +} + export interface MlQuestionAnsweringInferenceOptions { num_top_classes?: integer tokenization?: MlTokenizationConfigContainer @@ -15700,6 +15715,7 @@ export interface MlTextClassificationInferenceOptions { tokenization?: MlTokenizationConfigContainer results_field?: string classification_labels?: string[] + vocabulary?: MlVocabulary } export interface MlTextClassificationInferenceUpdateOptions { @@ -15742,6 +15758,7 @@ export interface MlTokenizationConfigContainer { bert_ja?: MlNlpBertTokenizationConfig mpnet?: MlNlpBertTokenizationConfig roberta?: MlNlpRobertaTokenizationConfig + xlm_roberta?: MlXlmRobertaTokenizationConfig } export type MlTokenizationTruncate = 'first' | 'second' | 'none' @@ -15819,6 +15836,7 @@ export interface MlTrainedModelConfig { model_size_bytes?: ByteSize model_package?: MlModelPackageConfig location?: MlTrainedModelLocation + platform_architecture?: string prefix_strings?: MlTrainedModelPrefixStrings } @@ -15954,6 +15972,9 @@ export interface MlVocabulary { index: IndexName } +export interface MlXlmRobertaTokenizationConfig extends MlCommonTokenizationConfig { +} + export interface MlZeroShotClassificationInferenceOptions { tokenization?: MlTokenizationConfigContainer hypothesis_template?: string diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index a5c72d352f..7c3ea7fc9d 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -60,7 +60,7 @@ export class InferenceEndpointInfo extends InferenceEndpoint { /** * Chunking configuration object */ -export class InferenceChunkingSettings extends InferenceEndpoint { +export class InferenceChunkingSettings { /** * The maximum size of a chunk in words. * This value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy). diff --git a/specification/ml/_types/TrainedModel.ts b/specification/ml/_types/TrainedModel.ts index 9374dd09b0..acc7fe5c4f 100644 --- a/specification/ml/_types/TrainedModel.ts +++ b/specification/ml/_types/TrainedModel.ts @@ -235,6 +235,7 @@ export class TrainedModelConfig { model_size_bytes?: ByteSize model_package?: ModelPackageConfig location?: TrainedModelLocation + platform_architecture?: string prefix_strings?: TrainedModelPrefixStrings } diff --git a/specification/ml/_types/inference.ts b/specification/ml/_types/inference.ts index 856120e27c..1cc539dc27 100644 --- a/specification/ml/_types/inference.ts +++ b/specification/ml/_types/inference.ts @@ -17,8 +17,11 @@ * under the License. */ +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, IndexName, ScalarValue } from '@_types/common' -import { double, integer } from '@_types/Numeric' +import { double, float, integer } from '@_types/Numeric' +import { QueryContainer } from '@_types/query_dsl/abstractions' /** * Inference configuration provided when storing the model config @@ -47,6 +50,8 @@ export class InferenceConfigCreateContainer { * @availability serverless */ fill_mask?: FillMaskInferenceOptions + + learning_to_rank?: LearningToRankConfig /** * Named entity recognition configuration for inference. * @availability stack since=8.0.0 @@ -79,6 +84,26 @@ export class InferenceConfigCreateContainer { question_answering?: QuestionAnsweringInferenceOptions } +export class LearningToRankConfig { + default_params?: Dictionary + feature_extractors?: Dictionary[] + num_top_feature_importance_values: integer +} + +/** + * @variants external + */ +export type FeatureExtractor = QueryFeatureExtractor + +/** + * @variant name=query_extractor + */ +export class QueryFeatureExtractor { + default_score?: float + feature_name: string + query: QueryContainer +} + export class RegressionInferenceOptions { /** The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. */ results_field?: Field @@ -128,6 +153,8 @@ export class TokenizationConfigContainer { * @availability serverless * */ roberta?: NlpRobertaTokenizationConfig + + xlm_roberta?: XlmRobertaTokenizationConfig } export class CommonTokenizationConfig { @@ -170,6 +197,8 @@ export class NlpRobertaTokenizationConfig extends CommonTokenizationConfig { add_prefix_space?: boolean } +export class XlmRobertaTokenizationConfig extends CommonTokenizationConfig {} + /** Text classification configuration options */ export class TextClassificationInferenceOptions { /** Specifies the number of top class predictions to return. Defaults to 0. */ @@ -180,6 +209,8 @@ export class TextClassificationInferenceOptions { results_field?: string /** Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels */ classification_labels?: string[] + + vocabulary?: Vocabulary } /** Zero shot classification configuration options */