Skip to content

Commit 216972d

Browse files
committed
[codegen] update to latest spec
1 parent b366315 commit 216972d

11 files changed

+856
-59
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,8 @@
18751875
'ml._types.Category': 'ml/_types/Category.ts#L23-L49',
18761876
'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L251-L264',
18771877
'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L245-L249',
1878-
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L93-L108',
1879-
'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L133-L159',
1878+
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L118-L133',
1879+
'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L160-L186',
18801880
'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79',
18811881
'ml._types.DataCounts': 'ml/_types/Job.ts#L352-L372',
18821882
'ml._types.DataDescription': 'ml/_types/Job.ts#L374-L390',
@@ -1925,8 +1925,8 @@
19251925
'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115',
19261926
'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26',
19271927
'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L122-L133',
1928-
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L318-L331',
1929-
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L333-L350',
1928+
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L319-L332',
1929+
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L334-L351',
19301930
'ml._types.DetectionRule': 'ml/_types/Rule.ts#L25-L39',
19311931
'ml._types.Detector': 'ml/_types/Detector.ts#L25-L67',
19321932
'ml._types.DetectorRead': 'ml/_types/Detector.ts#L69-L125',
@@ -1935,18 +1935,18 @@
19351935
'ml._types.DiscoveryNodeContent': 'ml/_types/DiscoveryNode.ts#L27-L37',
19361936
'ml._types.ExcludeFrequent': 'ml/_types/Detector.ts#L145-L150',
19371937
'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L204-L208',
1938-
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L253-L268',
1939-
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L399-L406',
1938+
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L284-L299',
1939+
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L430-L437',
19401940
'ml._types.Filter': 'ml/_types/Filter.ts#L22-L29',
19411941
'ml._types.FilterRef': 'ml/_types/Filter.ts#L31-L41',
19421942
'ml._types.FilterType': 'ml/_types/Filter.ts#L43-L46',
19431943
'ml._types.GeoResults': 'ml/_types/Anomaly.ts#L146-L155',
1944-
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L261-L275',
1944+
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L262-L276',
19451945
'ml._types.Hyperparameters': 'ml/_types/DataframeAnalytics.ts#L420-L526',
19461946
'ml._types.Include': 'ml/_types/Include.ts#L20-L47',
1947-
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L23-L80',
1948-
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L284-L306',
1949-
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L447-L495',
1947+
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L26-L85',
1948+
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L315-L337',
1949+
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L478-L526',
19501950
'ml._types.Influence': 'ml/_types/Anomaly.ts#L141-L144',
19511951
'ml._types.Influencer': 'ml/_types/Influencer.ts#L24-L76',
19521952
'ml._types.Job': 'ml/_types/Job.ts#L61-L180',
@@ -1958,70 +1958,73 @@
19581958
'ml._types.JobStatistics': 'ml/_types/Job.ts#L54-L59',
19591959
'ml._types.JobStats': 'ml/_types/Job.ts#L284-L330',
19601960
'ml._types.JobTimingStats': 'ml/_types/Job.ts#L332-L341',
1961+
'ml._types.LearningToRankConfig': 'ml/_types/inference.ts#L87-L91',
19611962
'ml._types.MemoryStatus': 'ml/_types/Model.ts#L89-L93',
1962-
'ml._types.ModelPackageConfig': 'ml/_types/TrainedModel.ts#L244-L259',
1963+
'ml._types.ModelPackageConfig': 'ml/_types/TrainedModel.ts#L245-L260',
19631964
'ml._types.ModelPlotConfig': 'ml/_types/ModelPlot.ts#L23-L42',
19641965
'ml._types.ModelSizeStats': 'ml/_types/Model.ts#L59-L82',
19651966
'ml._types.ModelSnapshot': 'ml/_types/Model.ts#L25-L46',
19661967
'ml._types.ModelSnapshotUpgrade': 'ml/_types/Model.ts#L48-L57',
1967-
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L242-L251',
1968-
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L392-L397',
1969-
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L161-L162',
1970-
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L164-L171',
1971-
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L344-L349',
1968+
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L273-L282',
1969+
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L423-L428',
1970+
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L188-L189',
1971+
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L191-L198',
1972+
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L375-L380',
19721973
'ml._types.OutlierDetectionParameters': 'ml/_types/DataframeAnalytics.ts#L528-L562',
19731974
'ml._types.OverallBucket': 'ml/_types/Bucket.ts#L129-L144',
19741975
'ml._types.OverallBucketJob': 'ml/_types/Bucket.ts#L145-L148',
19751976
'ml._types.Page': 'ml/_types/Page.ts#L22-L33',
1976-
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L208-L215',
1977-
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L373-L378',
1977+
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L239-L246',
1978+
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L404-L409',
19781979
'ml._types.PerPartitionCategorization': 'ml/_types/Analysis.ts#L150-L159',
1979-
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L270-L280',
1980-
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L408-L419',
1981-
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L82-L91',
1982-
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L395-L416',
1980+
'ml._types.QueryFeatureExtractor': 'ml/_types/inference.ts#L98-L105',
1981+
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L301-L311',
1982+
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L439-L450',
1983+
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L107-L116',
1984+
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L396-L417',
19831985
'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50',
19841986
'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65',
19851987
'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L226-L243',
19861988
'ml._types.SnapshotUpgradeState': 'ml/_types/Model.ts#L95-L100',
1987-
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L173-L183',
1988-
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L351-L360',
1989-
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L221-L231',
1990-
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L380-L384',
1991-
'ml._types.TextExpansionInferenceOptions': 'ml/_types/inference.ts#L233-L240',
1992-
'ml._types.TextExpansionInferenceUpdateOptions': 'ml/_types/inference.ts#L386-L390',
1989+
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L202-L214',
1990+
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L382-L391',
1991+
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L252-L262',
1992+
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L411-L415',
1993+
'ml._types.TextExpansionInferenceOptions': 'ml/_types/inference.ts#L264-L271',
1994+
'ml._types.TextExpansionInferenceUpdateOptions': 'ml/_types/inference.ts#L417-L421',
19931995
'ml._types.TimingStats': 'ml/_types/DataframeAnalytics.ts#L564-L569',
1994-
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L110-L131',
1995-
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L338-L342',
1996-
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L428-L432',
1997-
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L277-L284',
1998-
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L286-L291',
1999-
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L293-L300',
2000-
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L447-L464',
2001-
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L418-L436',
2002-
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L357-L393',
2003-
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L191-L227',
2004-
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L229-L232',
2005-
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L234-L242',
2006-
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L438-L445',
1996+
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L135-L158',
1997+
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L369-L373',
1998+
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L459-L463',
1999+
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L278-L285',
2000+
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L287-L292',
2001+
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L294-L301',
2002+
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L448-L465',
2003+
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L419-L437',
2004+
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L358-L394',
2005+
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L191-L228',
2006+
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L230-L233',
2007+
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L235-L243',
2008+
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L439-L446',
20072009
'ml._types.TrainedModelDeploymentNodesStats': 'ml/_types/TrainedModel.ts#L144-L189',
20082010
'ml._types.TrainedModelDeploymentStats': 'ml/_types/TrainedModel.ts#L62-L107',
2009-
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L421-L427',
2010-
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L434-L437',
2011-
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L439-L443',
2011+
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L452-L458',
2012+
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L465-L468',
2013+
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L470-L474',
20122014
'ml._types.TrainedModelInferenceStats': 'ml/_types/TrainedModel.ts#L115-L135',
2013-
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L466-L468',
2014-
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L470-L472',
2015-
'ml._types.TrainedModelPrefixStrings': 'ml/_types/TrainedModel.ts#L474-L483',
2015+
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L467-L469',
2016+
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L471-L473',
2017+
'ml._types.TrainedModelPrefixStrings': 'ml/_types/TrainedModel.ts#L475-L484',
20162018
'ml._types.TrainedModelSizeStats': 'ml/_types/TrainedModel.ts#L137-L142',
20172019
'ml._types.TrainedModelStats': 'ml/_types/TrainedModel.ts#L42-L60',
2018-
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L302-L316',
2019-
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L352-L355',
2020+
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L303-L317',
2021+
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L353-L356',
20202022
'ml._types.TransformAuthorization': 'ml/_types/Authorization.ts#L59-L71',
20212023
'ml._types.ValidationLoss': 'ml/_types/DataframeAnalytics.ts#L571-L576',
2022-
'ml._types.Vocabulary': 'ml/_types/inference.ts#L217-L219',
2023-
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L185-L206',
2024-
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L362-L371',
2024+
'ml._types.Vocabulary': 'ml/_types/inference.ts#L248-L250',
2025+
'ml._types.XlmRobertaTokenizationConfig': 'ml/_types/inference.ts#L200-L200',
2026+
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L216-L237',
2027+
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L393-L402',
20252028
'ml.clear_trained_model_deployment_cache.Request': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheRequest.ts#L23-L42',
20262029
'ml.clear_trained_model_deployment_cache.Response': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheResponse.ts#L20-L24',
20272030
'ml.close_job.Request': 'ml/close_job/MlCloseJobRequest.ts#L24-L78',
@@ -3046,10 +3049,10 @@
30463049
if (hash.length > 1) {
30473050
hash = hash.substring(1);
30483051
}
3049-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/ea2a85c0d14014c2e326d1455e5ac3a8ff45a076/specification/" + (paths[hash] || "");
3052+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/1a48397b0921bfc50fe27895ea772f222082892b/specification/" + (paths[hash] || "");
30503053
</script>
30513054
</head>
30523055
<body>
3053-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/ea2a85c0d14014c2e326d1455e5ac3a8ff45a076/specification/">Elasticsearch API specification</a>.
3056+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/1a48397b0921bfc50fe27895ea772f222082892b/specification/">Elasticsearch API specification</a>.
30543057
</body>
30553058
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceChunkingSettings.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
import co.elastic.clients.json.JsonpDeserializable;
2323
import co.elastic.clients.json.JsonpDeserializer;
2424
import co.elastic.clients.json.JsonpMapper;
25+
import co.elastic.clients.json.JsonpSerializable;
26+
import co.elastic.clients.json.JsonpUtils;
2527
import co.elastic.clients.json.ObjectBuilderDeserializer;
2628
import co.elastic.clients.json.ObjectDeserializer;
2729
import co.elastic.clients.util.ObjectBuilder;
30+
import co.elastic.clients.util.WithJsonObjectBuilderBase;
2831
import jakarta.json.stream.JsonGenerator;
2932
import java.lang.Integer;
3033
import java.lang.String;
@@ -57,7 +60,7 @@
5760
* specification</a>
5861
*/
5962
@JsonpDeserializable
60-
public class InferenceChunkingSettings extends InferenceEndpoint {
63+
public class InferenceChunkingSettings implements JsonpSerializable {
6164
@Nullable
6265
private final Integer maxChunkSize;
6366

@@ -73,7 +76,6 @@ public class InferenceChunkingSettings extends InferenceEndpoint {
7376
// ---------------------------------------------------------------------------------------------
7477

7578
private InferenceChunkingSettings(Builder builder) {
76-
super(builder);
7779

7880
this.maxChunkSize = builder.maxChunkSize;
7981
this.overlap = builder.overlap;
@@ -134,9 +136,17 @@ public final String strategy() {
134136
return this.strategy;
135137
}
136138

139+
/**
140+
* Serialize this object to JSON.
141+
*/
142+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
143+
generator.writeStartObject();
144+
serializeInternal(generator, mapper);
145+
generator.writeEnd();
146+
}
147+
137148
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
138149

139-
super.serializeInternal(generator, mapper);
140150
if (this.maxChunkSize != null) {
141151
generator.writeKey("max_chunk_size");
142152
generator.write(this.maxChunkSize);
@@ -160,13 +170,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
160170

161171
}
162172

173+
@Override
174+
public String toString() {
175+
return JsonpUtils.toString(this);
176+
}
177+
163178
// ---------------------------------------------------------------------------------------------
164179

165180
/**
166181
* Builder for {@link InferenceChunkingSettings}.
167182
*/
168183

169-
public static class Builder extends InferenceEndpoint.AbstractBuilder<Builder>
184+
public static class Builder extends WithJsonObjectBuilderBase<Builder>
170185
implements
171186
ObjectBuilder<InferenceChunkingSettings> {
172187
@Nullable
@@ -257,7 +272,7 @@ public InferenceChunkingSettings build() {
257272

258273
protected static void setupInferenceChunkingSettingsDeserializer(
259274
ObjectDeserializer<InferenceChunkingSettings.Builder> op) {
260-
InferenceEndpoint.setupInferenceEndpointDeserializer(op);
275+
261276
op.add(Builder::maxChunkSize, JsonpDeserializer.integerDeserializer(), "max_chunk_size");
262277
op.add(Builder::overlap, JsonpDeserializer.integerDeserializer(), "overlap");
263278
op.add(Builder::sentenceOverlap, JsonpDeserializer.integerDeserializer(), "sentence_overlap");

java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigCreate.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public enum Kind implements JsonEnum {
8484

8585
FillMask("fill_mask"),
8686

87+
LearningToRank("learning_to_rank"),
88+
8789
Ner("ner"),
8890

8991
PassThrough("pass_through"),
@@ -226,6 +228,24 @@ public FillMaskInferenceOptions fillMask() {
226228
return TaggedUnionUtils.get(this, Kind.FillMask);
227229
}
228230

231+
/**
232+
* Is this variant instance of kind {@code learning_to_rank}?
233+
*/
234+
public boolean isLearningToRank() {
235+
return _kind == Kind.LearningToRank;
236+
}
237+
238+
/**
239+
* Get the {@code learning_to_rank} variant value.
240+
*
241+
* @throws IllegalStateException
242+
* if the current variant is not of the {@code learning_to_rank}
243+
* kind.
244+
*/
245+
public LearningToRankConfig learningToRank() {
246+
return TaggedUnionUtils.get(this, Kind.LearningToRank);
247+
}
248+
229249
/**
230250
* Is this variant instance of kind {@code ner}?
231251
*/
@@ -397,6 +417,17 @@ public ObjectBuilder<InferenceConfigCreate> fillMask(
397417
return this.fillMask(fn.apply(new FillMaskInferenceOptions.Builder()).build());
398418
}
399419

420+
public ObjectBuilder<InferenceConfigCreate> learningToRank(LearningToRankConfig v) {
421+
this._kind = Kind.LearningToRank;
422+
this._value = v;
423+
return this;
424+
}
425+
426+
public ObjectBuilder<InferenceConfigCreate> learningToRank(
427+
Function<LearningToRankConfig.Builder, ObjectBuilder<LearningToRankConfig>> fn) {
428+
return this.learningToRank(fn.apply(new LearningToRankConfig.Builder()).build());
429+
}
430+
400431
public ObjectBuilder<InferenceConfigCreate> ner(NerInferenceOptions v) {
401432
this._kind = Kind.Ner;
402433
this._value = v;
@@ -467,6 +498,7 @@ protected static void setupInferenceConfigCreateDeserializer(ObjectDeserializer<
467498
op.add(Builder::zeroShotClassification, ZeroShotClassificationInferenceOptions._DESERIALIZER,
468499
"zero_shot_classification");
469500
op.add(Builder::fillMask, FillMaskInferenceOptions._DESERIALIZER, "fill_mask");
501+
op.add(Builder::learningToRank, LearningToRankConfig._DESERIALIZER, "learning_to_rank");
470502
op.add(Builder::ner, NerInferenceOptions._DESERIALIZER, "ner");
471503
op.add(Builder::passThrough, PassThroughInferenceOptions._DESERIALIZER, "pass_through");
472504
op.add(Builder::textEmbedding, TextEmbeddingInferenceOptions._DESERIALIZER, "text_embedding");

java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigCreateBuilders.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ public static InferenceConfigCreate fillMask(
141141
return builder.build();
142142
}
143143

144+
/**
145+
* Creates a builder for the {@link LearningToRankConfig learning_to_rank}
146+
* {@code InferenceConfigCreate} variant.
147+
*/
148+
public static LearningToRankConfig.Builder learningToRank() {
149+
return new LearningToRankConfig.Builder();
150+
}
151+
152+
/**
153+
* Creates a InferenceConfigCreate of the {@link LearningToRankConfig
154+
* learning_to_rank} {@code InferenceConfigCreate} variant.
155+
*/
156+
public static InferenceConfigCreate learningToRank(
157+
Function<LearningToRankConfig.Builder, ObjectBuilder<LearningToRankConfig>> fn) {
158+
InferenceConfigCreate.Builder builder = new InferenceConfigCreate.Builder();
159+
builder.learningToRank(fn.apply(new LearningToRankConfig.Builder()).build());
160+
return builder.build();
161+
}
162+
144163
/**
145164
* Creates a builder for the {@link NerInferenceOptions ner}
146165
* {@code InferenceConfigCreate} variant.

0 commit comments

Comments
 (0)