Skip to content

Commit 5c39685

Browse files
Fixing tests
1 parent 6523643 commit 5c39685

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/CustomServiceSettingsTests.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ public void testFromMap() {
158158
requestContentString,
159159
responseParser,
160160
new RateLimitSettings(10_000),
161-
11
161+
11,
162+
InputTypeTranslator.EMPTY_TRANSLATOR
162163
)
163164
)
164165
);
@@ -587,7 +588,8 @@ public void testXContent() throws IOException {
587588
},
588589
"rate_limit": {
589590
"requests_per_minute": 10000
590-
}
591+
},
592+
"batch_size": 10
591593
}
592594
""");
593595

@@ -603,6 +605,7 @@ public void testXContent_WithInputTypeTranslationValues() throws IOException {
603605
"string",
604606
new TextEmbeddingResponseParser("$.result.embeddings[*].embedding"),
605607
null,
608+
null,
606609
new InputTypeTranslator(Map.of(InputType.SEARCH, "do_search", InputType.INGEST, "do_ingest"), "a_default")
607610
);
608611

@@ -648,7 +651,8 @@ public void testXContent_BatchSize11() throws IOException {
648651
"string",
649652
new TextEmbeddingResponseParser("$.result.embeddings[*].embedding"),
650653
null,
651-
11
654+
11,
655+
InputTypeTranslator.EMPTY_TRANSLATOR
652656
);
653657

654658
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
@@ -667,6 +671,10 @@ public void testXContent_BatchSize11() throws IOException {
667671
"text_embeddings": "$.result.embeddings[*].embedding"
668672
}
669673
},
674+
"input_type": {
675+
"translation": {},
676+
"default": ""
677+
},
670678
"rate_limit": {
671679
"requests_per_minute": 10000
672680
},

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/CustomServiceTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ private static CustomModel createInternalEmbeddingModel(
276276
"{\"input\":${input}}",
277277
parser,
278278
new RateLimitSettings(10_000),
279-
batchSize
279+
batchSize,
280+
InputTypeTranslator.EMPTY_TRANSLATOR
280281
),
281282
new CustomTaskSettings(Map.of("key", "test_value")),
282283
new CustomSecretSettings(Map.of("test_key", new SecureString("test_value".toCharArray()))),

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/request/CustomRequestTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public void testCreateRequest() throws IOException {
6868
requestContentString,
6969
new TextEmbeddingResponseParser("$.result.embeddings"),
7070
new RateLimitSettings(10_000),
71+
null,
7172
new InputTypeTranslator(Map.of(InputType.INGEST, "value"), "default")
7273
);
7374

@@ -130,6 +131,7 @@ public void testCreateRequest_QueryParametersAreEscaped_AndEncoded() throws IOEx
130131
requestContentString,
131132
new TextEmbeddingResponseParser("$.result.embeddings"),
132133
new RateLimitSettings(10_000),
134+
null,
133135
new InputTypeTranslator(Map.of(InputType.INGEST, "value"), "default")
134136
);
135137

0 commit comments

Comments
 (0)