Skip to content

Commit 853ff4f

Browse files
committed
[codegen] update to latest spec
1 parent fab68a7 commit 853ff4f

11 files changed

+856
-59
lines changed

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

+57-54
Original file line numberDiff line numberDiff line change
@@ -1852,8 +1852,8 @@
18521852
'ml._types.Category': 'ml/_types/Category.ts#L23-L49',
18531853
'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L251-L264',
18541854
'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L245-L249',
1855-
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L93-L108',
1856-
'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L133-L159',
1855+
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L118-L133',
1856+
'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L160-L186',
18571857
'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79',
18581858
'ml._types.DataCounts': 'ml/_types/Job.ts#L352-L372',
18591859
'ml._types.DataDescription': 'ml/_types/Job.ts#L374-L390',
@@ -1902,8 +1902,8 @@
19021902
'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115',
19031903
'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26',
19041904
'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L122-L133',
1905-
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L318-L331',
1906-
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L333-L350',
1905+
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L319-L332',
1906+
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L334-L351',
19071907
'ml._types.DetectionRule': 'ml/_types/Rule.ts#L25-L39',
19081908
'ml._types.Detector': 'ml/_types/Detector.ts#L25-L67',
19091909
'ml._types.DetectorRead': 'ml/_types/Detector.ts#L69-L125',
@@ -1912,18 +1912,18 @@
19121912
'ml._types.DiscoveryNodeContent': 'ml/_types/DiscoveryNode.ts#L27-L37',
19131913
'ml._types.ExcludeFrequent': 'ml/_types/Detector.ts#L145-L150',
19141914
'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L204-L208',
1915-
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L253-L268',
1916-
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L399-L406',
1915+
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L284-L299',
1916+
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L430-L437',
19171917
'ml._types.Filter': 'ml/_types/Filter.ts#L22-L29',
19181918
'ml._types.FilterRef': 'ml/_types/Filter.ts#L31-L41',
19191919
'ml._types.FilterType': 'ml/_types/Filter.ts#L43-L46',
19201920
'ml._types.GeoResults': 'ml/_types/Anomaly.ts#L146-L155',
1921-
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L261-L275',
1921+
'ml._types.Hyperparameter': 'ml/_types/TrainedModel.ts#L262-L276',
19221922
'ml._types.Hyperparameters': 'ml/_types/DataframeAnalytics.ts#L420-L526',
19231923
'ml._types.Include': 'ml/_types/Include.ts#L20-L47',
1924-
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L23-L80',
1925-
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L284-L306',
1926-
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L447-L495',
1924+
'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L26-L85',
1925+
'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L315-L337',
1926+
'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L478-L526',
19271927
'ml._types.Influence': 'ml/_types/Anomaly.ts#L141-L144',
19281928
'ml._types.Influencer': 'ml/_types/Influencer.ts#L24-L76',
19291929
'ml._types.Job': 'ml/_types/Job.ts#L61-L180',
@@ -1935,70 +1935,73 @@
19351935
'ml._types.JobStatistics': 'ml/_types/Job.ts#L54-L59',
19361936
'ml._types.JobStats': 'ml/_types/Job.ts#L284-L330',
19371937
'ml._types.JobTimingStats': 'ml/_types/Job.ts#L332-L341',
1938+
'ml._types.LearningToRankConfig': 'ml/_types/inference.ts#L87-L91',
19381939
'ml._types.MemoryStatus': 'ml/_types/Model.ts#L89-L93',
1939-
'ml._types.ModelPackageConfig': 'ml/_types/TrainedModel.ts#L244-L259',
1940+
'ml._types.ModelPackageConfig': 'ml/_types/TrainedModel.ts#L245-L260',
19401941
'ml._types.ModelPlotConfig': 'ml/_types/ModelPlot.ts#L23-L42',
19411942
'ml._types.ModelSizeStats': 'ml/_types/Model.ts#L59-L82',
19421943
'ml._types.ModelSnapshot': 'ml/_types/Model.ts#L25-L46',
19431944
'ml._types.ModelSnapshotUpgrade': 'ml/_types/Model.ts#L48-L57',
1944-
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L242-L251',
1945-
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L392-L397',
1946-
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L161-L162',
1947-
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L164-L171',
1948-
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L344-L349',
1945+
'ml._types.NerInferenceOptions': 'ml/_types/inference.ts#L273-L282',
1946+
'ml._types.NerInferenceUpdateOptions': 'ml/_types/inference.ts#L423-L428',
1947+
'ml._types.NlpBertTokenizationConfig': 'ml/_types/inference.ts#L188-L189',
1948+
'ml._types.NlpRobertaTokenizationConfig': 'ml/_types/inference.ts#L191-L198',
1949+
'ml._types.NlpTokenizationUpdateOptions': 'ml/_types/inference.ts#L375-L380',
19491950
'ml._types.OutlierDetectionParameters': 'ml/_types/DataframeAnalytics.ts#L528-L562',
19501951
'ml._types.OverallBucket': 'ml/_types/Bucket.ts#L129-L144',
19511952
'ml._types.OverallBucketJob': 'ml/_types/Bucket.ts#L145-L148',
19521953
'ml._types.Page': 'ml/_types/Page.ts#L22-L33',
1953-
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L208-L215',
1954-
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L373-L378',
1954+
'ml._types.PassThroughInferenceOptions': 'ml/_types/inference.ts#L239-L246',
1955+
'ml._types.PassThroughInferenceUpdateOptions': 'ml/_types/inference.ts#L404-L409',
19551956
'ml._types.PerPartitionCategorization': 'ml/_types/Analysis.ts#L150-L159',
1956-
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L270-L280',
1957-
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L408-L419',
1958-
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L82-L91',
1959-
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L395-L416',
1957+
'ml._types.QueryFeatureExtractor': 'ml/_types/inference.ts#L98-L105',
1958+
'ml._types.QuestionAnsweringInferenceOptions': 'ml/_types/inference.ts#L301-L311',
1959+
'ml._types.QuestionAnsweringInferenceUpdateOptions': 'ml/_types/inference.ts#L439-L450',
1960+
'ml._types.RegressionInferenceOptions': 'ml/_types/inference.ts#L107-L116',
1961+
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L396-L417',
19601962
'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50',
19611963
'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65',
19621964
'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L226-L243',
19631965
'ml._types.SnapshotUpgradeState': 'ml/_types/Model.ts#L95-L100',
1964-
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L173-L183',
1965-
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L351-L360',
1966-
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L221-L231',
1967-
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L380-L384',
1968-
'ml._types.TextExpansionInferenceOptions': 'ml/_types/inference.ts#L233-L240',
1969-
'ml._types.TextExpansionInferenceUpdateOptions': 'ml/_types/inference.ts#L386-L390',
1966+
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L202-L214',
1967+
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L382-L391',
1968+
'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L252-L262',
1969+
'ml._types.TextEmbeddingInferenceUpdateOptions': 'ml/_types/inference.ts#L411-L415',
1970+
'ml._types.TextExpansionInferenceOptions': 'ml/_types/inference.ts#L264-L271',
1971+
'ml._types.TextExpansionInferenceUpdateOptions': 'ml/_types/inference.ts#L417-L421',
19701972
'ml._types.TimingStats': 'ml/_types/DataframeAnalytics.ts#L564-L569',
1971-
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L110-L131',
1972-
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L338-L342',
1973-
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L428-L432',
1974-
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L277-L284',
1975-
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L286-L291',
1976-
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L293-L300',
1977-
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L447-L464',
1978-
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L418-L436',
1979-
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L357-L393',
1980-
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L191-L227',
1981-
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L229-L232',
1982-
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L234-L242',
1983-
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L438-L445',
1973+
'ml._types.TokenizationConfigContainer': 'ml/_types/inference.ts#L135-L158',
1974+
'ml._types.TokenizationTruncate': 'ml/_types/inference.ts#L369-L373',
1975+
'ml._types.TopClassEntry': 'ml/_types/inference.ts#L459-L463',
1976+
'ml._types.TotalFeatureImportance': 'ml/_types/TrainedModel.ts#L278-L285',
1977+
'ml._types.TotalFeatureImportanceClass': 'ml/_types/TrainedModel.ts#L287-L292',
1978+
'ml._types.TotalFeatureImportanceStatistics': 'ml/_types/TrainedModel.ts#L294-L301',
1979+
'ml._types.TrainedModelAssignment': 'ml/_types/TrainedModel.ts#L448-L465',
1980+
'ml._types.TrainedModelAssignmentRoutingTable': 'ml/_types/TrainedModel.ts#L419-L437',
1981+
'ml._types.TrainedModelAssignmentTaskParameters': 'ml/_types/TrainedModel.ts#L358-L394',
1982+
'ml._types.TrainedModelConfig': 'ml/_types/TrainedModel.ts#L191-L228',
1983+
'ml._types.TrainedModelConfigInput': 'ml/_types/TrainedModel.ts#L230-L233',
1984+
'ml._types.TrainedModelConfigMetadata': 'ml/_types/TrainedModel.ts#L235-L243',
1985+
'ml._types.TrainedModelDeploymentAllocationStatus': 'ml/_types/TrainedModel.ts#L439-L446',
19841986
'ml._types.TrainedModelDeploymentNodesStats': 'ml/_types/TrainedModel.ts#L144-L189',
19851987
'ml._types.TrainedModelDeploymentStats': 'ml/_types/TrainedModel.ts#L62-L107',
1986-
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L421-L427',
1987-
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L434-L437',
1988-
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L439-L443',
1988+
'ml._types.TrainedModelEntities': 'ml/_types/inference.ts#L452-L458',
1989+
'ml._types.TrainedModelInferenceClassImportance': 'ml/_types/inference.ts#L465-L468',
1990+
'ml._types.TrainedModelInferenceFeatureImportance': 'ml/_types/inference.ts#L470-L474',
19891991
'ml._types.TrainedModelInferenceStats': 'ml/_types/TrainedModel.ts#L115-L135',
1990-
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L466-L468',
1991-
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L470-L472',
1992-
'ml._types.TrainedModelPrefixStrings': 'ml/_types/TrainedModel.ts#L474-L483',
1992+
'ml._types.TrainedModelLocation': 'ml/_types/TrainedModel.ts#L467-L469',
1993+
'ml._types.TrainedModelLocationIndex': 'ml/_types/TrainedModel.ts#L471-L473',
1994+
'ml._types.TrainedModelPrefixStrings': 'ml/_types/TrainedModel.ts#L475-L484',
19931995
'ml._types.TrainedModelSizeStats': 'ml/_types/TrainedModel.ts#L137-L142',
19941996
'ml._types.TrainedModelStats': 'ml/_types/TrainedModel.ts#L42-L60',
1995-
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L302-L316',
1996-
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L352-L355',
1997+
'ml._types.TrainedModelType': 'ml/_types/TrainedModel.ts#L303-L317',
1998+
'ml._types.TrainingPriority': 'ml/_types/TrainedModel.ts#L353-L356',
19971999
'ml._types.TransformAuthorization': 'ml/_types/Authorization.ts#L59-L71',
19982000
'ml._types.ValidationLoss': 'ml/_types/DataframeAnalytics.ts#L571-L576',
1999-
'ml._types.Vocabulary': 'ml/_types/inference.ts#L217-L219',
2000-
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L185-L206',
2001-
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L362-L371',
2001+
'ml._types.Vocabulary': 'ml/_types/inference.ts#L248-L250',
2002+
'ml._types.XlmRobertaTokenizationConfig': 'ml/_types/inference.ts#L200-L200',
2003+
'ml._types.ZeroShotClassificationInferenceOptions': 'ml/_types/inference.ts#L216-L237',
2004+
'ml._types.ZeroShotClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L393-L402',
20022005
'ml.clear_trained_model_deployment_cache.Request': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheRequest.ts#L23-L42',
20032006
'ml.clear_trained_model_deployment_cache.Response': 'ml/clear_trained_model_deployment_cache/MlClearTrainedModelDeploymentCacheResponse.ts#L20-L24',
20042007
'ml.close_job.Request': 'ml/close_job/MlCloseJobRequest.ts#L24-L78',
@@ -2970,10 +2973,10 @@
29702973
if (hash.length > 1) {
29712974
hash = hash.substring(1);
29722975
}
2973-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/a7f36c9921ee9fa15e8ab778eedcbbf04e743092/specification/" + (paths[hash] || "");
2976+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/c00564eff0272d108c60271c404740322331a9be/specification/" + (paths[hash] || "");
29742977
</script>
29752978
</head>
29762979
<body>
2977-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/a7f36c9921ee9fa15e8ab778eedcbbf04e743092/specification/">Elasticsearch API specification</a>.
2980+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/c00564eff0272d108c60271c404740322331a9be/specification/">Elasticsearch API specification</a>.
29782981
</body>
29792982
</html>

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

+20-5
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

+32
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

+19
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)