@@ -46,7 +46,8 @@ protected InferenceAction.Request createTestInstance() {
46
46
randomList (1 , 5 , () -> randomAlphaOfLength (8 )),
47
47
randomMap (0 , 3 , () -> new Tuple <>(randomAlphaOfLength (4 ), randomAlphaOfLength (4 ))),
48
48
randomFrom (InputType .values ()),
49
- TimeValue .timeValueMillis (randomLongBetween (1 , 2048 ))
49
+ TimeValue .timeValueMillis (randomLongBetween (1 , 2048 )),
50
+ false
50
51
);
51
52
}
52
53
@@ -80,7 +81,8 @@ public void testValidation_TextEmbedding() {
80
81
List .of ("input" ),
81
82
null ,
82
83
null ,
83
- null
84
+ null ,
85
+ false
84
86
);
85
87
ActionRequestValidationException e = request .validate ();
86
88
assertNull (e );
@@ -94,7 +96,8 @@ public void testValidation_Rerank() {
94
96
List .of ("input" ),
95
97
null ,
96
98
null ,
97
- null
99
+ null ,
100
+ false
98
101
);
99
102
ActionRequestValidationException e = request .validate ();
100
103
assertNull (e );
@@ -108,7 +111,8 @@ public void testValidation_TextEmbedding_Null() {
108
111
null ,
109
112
null ,
110
113
null ,
111
- null
114
+ null ,
115
+ false
112
116
);
113
117
ActionRequestValidationException inputNullError = inputNullRequest .validate ();
114
118
assertNotNull (inputNullError );
@@ -123,7 +127,8 @@ public void testValidation_TextEmbedding_Empty() {
123
127
List .of (),
124
128
null ,
125
129
null ,
126
- null
130
+ null ,
131
+ false
127
132
);
128
133
ActionRequestValidationException inputEmptyError = inputEmptyRequest .validate ();
129
134
assertNotNull (inputEmptyError );
@@ -138,7 +143,8 @@ public void testValidation_Rerank_Null() {
138
143
List .of ("input" ),
139
144
null ,
140
145
null ,
141
- null
146
+ null ,
147
+ false
142
148
);
143
149
ActionRequestValidationException queryNullError = queryNullRequest .validate ();
144
150
assertNotNull (queryNullError );
@@ -153,7 +159,8 @@ public void testValidation_Rerank_Empty() {
153
159
List .of ("input" ),
154
160
null ,
155
161
null ,
156
- null
162
+ null ,
163
+ false
157
164
);
158
165
ActionRequestValidationException queryEmptyError = queryEmptyRequest .validate ();
159
166
assertNotNull (queryEmptyError );
@@ -185,7 +192,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
185
192
instance .getInput (),
186
193
instance .getTaskSettings (),
187
194
instance .getInputType (),
188
- instance .getInferenceTimeout ()
195
+ instance .getInferenceTimeout (),
196
+ false
189
197
);
190
198
}
191
199
case 1 -> new InferenceAction .Request (
@@ -195,7 +203,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
195
203
instance .getInput (),
196
204
instance .getTaskSettings (),
197
205
instance .getInputType (),
198
- instance .getInferenceTimeout ()
206
+ instance .getInferenceTimeout (),
207
+ false
199
208
);
200
209
case 2 -> {
201
210
var changedInputs = new ArrayList <String >(instance .getInput ());
@@ -207,7 +216,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
207
216
changedInputs ,
208
217
instance .getTaskSettings (),
209
218
instance .getInputType (),
210
- instance .getInferenceTimeout ()
219
+ instance .getInferenceTimeout (),
220
+ false
211
221
);
212
222
}
213
223
case 3 -> {
@@ -225,7 +235,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
225
235
instance .getInput (),
226
236
taskSettings ,
227
237
instance .getInputType (),
228
- instance .getInferenceTimeout ()
238
+ instance .getInferenceTimeout (),
239
+ false
229
240
);
230
241
}
231
242
case 4 -> {
@@ -237,7 +248,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
237
248
instance .getInput (),
238
249
instance .getTaskSettings (),
239
250
nextInputType ,
240
- instance .getInferenceTimeout ()
251
+ instance .getInferenceTimeout (),
252
+ false
241
253
);
242
254
}
243
255
case 5 -> new InferenceAction .Request (
@@ -247,7 +259,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
247
259
instance .getInput (),
248
260
instance .getTaskSettings (),
249
261
instance .getInputType (),
250
- instance .getInferenceTimeout ()
262
+ instance .getInferenceTimeout (),
263
+ false
251
264
);
252
265
case 6 -> {
253
266
var newDuration = Duration .of (
@@ -262,7 +275,8 @@ protected InferenceAction.Request mutateInstance(InferenceAction.Request instanc
262
275
instance .getInput (),
263
276
instance .getTaskSettings (),
264
277
instance .getInputType (),
265
- TimeValue .timeValueMillis (newDuration .plus (additionalTime ).toMillis ())
278
+ TimeValue .timeValueMillis (newDuration .plus (additionalTime ).toMillis ()),
279
+ false
266
280
);
267
281
}
268
282
default -> throw new UnsupportedOperationException ();
@@ -279,7 +293,8 @@ protected InferenceAction.Request mutateInstanceForVersion(InferenceAction.Reque
279
293
instance .getInput ().subList (0 , 1 ),
280
294
instance .getTaskSettings (),
281
295
InputType .UNSPECIFIED ,
282
- InferenceAction .Request .DEFAULT_TIMEOUT
296
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
297
+ false
283
298
);
284
299
} else if (version .before (TransportVersions .V_8_13_0 )) {
285
300
return new InferenceAction .Request (
@@ -289,7 +304,8 @@ protected InferenceAction.Request mutateInstanceForVersion(InferenceAction.Reque
289
304
instance .getInput (),
290
305
instance .getTaskSettings (),
291
306
InputType .UNSPECIFIED ,
292
- InferenceAction .Request .DEFAULT_TIMEOUT
307
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
308
+ false
293
309
);
294
310
} else if (version .before (TransportVersions .V_8_13_0 )
295
311
&& (instance .getInputType () == InputType .UNSPECIFIED
@@ -302,7 +318,8 @@ protected InferenceAction.Request mutateInstanceForVersion(InferenceAction.Reque
302
318
instance .getInput (),
303
319
instance .getTaskSettings (),
304
320
InputType .INGEST ,
305
- InferenceAction .Request .DEFAULT_TIMEOUT
321
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
322
+ false
306
323
);
307
324
} else if (version .before (TransportVersions .V_8_13_0 )
308
325
&& (instance .getInputType () == InputType .CLUSTERING || instance .getInputType () == InputType .CLASSIFICATION )) {
@@ -313,7 +330,8 @@ protected InferenceAction.Request mutateInstanceForVersion(InferenceAction.Reque
313
330
instance .getInput (),
314
331
instance .getTaskSettings (),
315
332
InputType .UNSPECIFIED ,
316
- InferenceAction .Request .DEFAULT_TIMEOUT
333
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
334
+ false
317
335
);
318
336
} else if (version .before (TransportVersions .V_8_14_0 )) {
319
337
return new InferenceAction .Request (
@@ -323,7 +341,8 @@ protected InferenceAction.Request mutateInstanceForVersion(InferenceAction.Reque
323
341
instance .getInput (),
324
342
instance .getTaskSettings (),
325
343
instance .getInputType (),
326
- InferenceAction .Request .DEFAULT_TIMEOUT
344
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
345
+ false
327
346
);
328
347
}
329
348
@@ -339,7 +358,8 @@ public void testWriteTo_WhenVersionIsOnAfterUnspecifiedAdded() throws IOExceptio
339
358
List .of (),
340
359
Map .of (),
341
360
InputType .UNSPECIFIED ,
342
- InferenceAction .Request .DEFAULT_TIMEOUT
361
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
362
+ false
343
363
),
344
364
TransportVersions .V_8_13_0
345
365
);
@@ -353,7 +373,8 @@ public void testWriteTo_WhenVersionIsBeforeInputTypeAdded_ShouldSetInputTypeToUn
353
373
List .of (),
354
374
Map .of (),
355
375
InputType .INGEST ,
356
- InferenceAction .Request .DEFAULT_TIMEOUT
376
+ InferenceAction .Request .DEFAULT_TIMEOUT ,
377
+ false
357
378
);
358
379
359
380
InferenceAction .Request deserializedInstance = copyWriteable (
0 commit comments