Skip to content

Commit 2354e8f

Browse files
[ML] Replace test-only SenderService API (#112718)
This API was only being used by tests Co-authored-by: Elastic Machine <[email protected]>
1 parent 2371cae commit 2354e8f

File tree

11 files changed

+13
-14
lines changed

11 files changed

+13
-14
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/SenderService.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@ public void infer(
6161
}
6262
}
6363

64-
public void chunkedInfer(
65-
Model model,
66-
List<String> input,
67-
Map<String, Object> taskSettings,
68-
InputType inputType,
69-
ChunkingOptions chunkingOptions,
70-
TimeValue timeout,
71-
ActionListener<List<ChunkedInferenceServiceResults>> listener
72-
) {
73-
init();
74-
chunkedInfer(model, null, input, taskSettings, inputType, chunkingOptions, timeout, listener);
75-
}
76-
7764
@Override
7865
public void chunkedInfer(
7966
Model model,
@@ -86,7 +73,7 @@ public void chunkedInfer(
8673
ActionListener<List<ChunkedInferenceServiceResults>> listener
8774
) {
8875
init();
89-
doChunkedInfer(model, null, input, taskSettings, inputType, chunkingOptions, timeout, listener);
76+
doChunkedInfer(model, query, input, taskSettings, inputType, chunkingOptions, timeout, listener);
9077
}
9178

9279
protected abstract void doInfer(

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ public void testChunkedInfer_CallsInfer_ConvertsFloatResponse_ForEmbeddings() th
10721072
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
10731073
service.chunkedInfer(
10741074
model,
1075+
null,
10751076
List.of("abc", "xyz"),
10761077
new HashMap<>(),
10771078
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ public void testChunkedInfer() throws IOException {
897897
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
898898
service.chunkedInfer(
899899
model,
900+
null,
900901
List.of("foo", "bar"),
901902
new HashMap<>(),
902903
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/azureopenai/AzureOpenAiServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ public void testChunkedInfer_CallsInfer_ConvertsFloatResponse() throws IOExcepti
11041104
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
11051105
service.chunkedInfer(
11061106
model,
1107+
null,
11071108
List.of("foo", "bar"),
11081109
new HashMap<>(),
11091110
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/cohere/CohereServiceTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,7 @@ public void testChunkedInfer_BatchesCalls() throws IOException {
12101210
// 2 inputs
12111211
service.chunkedInfer(
12121212
model,
1213+
null,
12131214
List.of("foo", "bar"),
12141215
new HashMap<>(),
12151216
InputType.UNSPECIFIED,
@@ -1301,6 +1302,7 @@ public void testChunkedInfer_BatchesCalls_Bytes() throws IOException {
13011302
// 2 inputs
13021303
service.chunkedInfer(
13031304
model,
1305+
null,
13041306
List.of("foo", "bar"),
13051307
new HashMap<>(),
13061308
InputType.UNSPECIFIED,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elastic/ElasticInferenceServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ public void testChunkedInfer_PassesThrough() throws IOException {
476476
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
477477
service.chunkedInfer(
478478
model,
479+
null,
479480
List.of("input text"),
480481
new HashMap<>(),
481482
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ public void testChunkedInfer_Batches() throws IOException {
697697
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
698698
service.chunkedInfer(
699699
model,
700+
null,
700701
input,
701702
new HashMap<>(),
702703
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceElserServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public void testChunkedInfer_CallsInfer_Elser_ConvertsFloatResponse() throws IOE
8787
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
8888
service.chunkedInfer(
8989
model,
90+
null,
9091
List.of("abc"),
9192
new HashMap<>(),
9293
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceServiceTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ public void testChunkedInfer_CallsInfer_TextEmbedding_ConvertsFloatResponse() th
616616
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
617617
service.chunkedInfer(
618618
model,
619+
null,
619620
List.of("abc"),
620621
new HashMap<>(),
621622
InputType.INGEST,
@@ -671,6 +672,7 @@ public void testChunkedInfer() throws IOException {
671672
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
672673
service.chunkedInfer(
673674
model,
675+
null,
674676
List.of("abc"),
675677
new HashMap<>(),
676678
InputType.INGEST,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/mistral/MistralServiceTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ public void testChunkedInfer_Embeddings_CallsInfer_ConvertsFloatResponse() throw
464464
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
465465
service.chunkedInfer(
466466
model,
467+
null,
467468
List.of("abc", "def"),
468469
new HashMap<>(),
469470
InputType.INGEST,

0 commit comments

Comments
 (0)