Skip to content

Commit e085040

Browse files
Merge branch 'custom-inference-service-jon' of github.com:jonathan-buttner/elasticsearch into custom-inference-service-jon
2 parents 95f05d2 + 7d2c112 commit e085040

File tree

3 files changed

+28
-48
lines changed

3 files changed

+28
-48
lines changed

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,7 @@ public void testParseRequestConfig_ThrowsWhenAnExtraKeyExistsInServiceSettingsMa
252252
fail("Expected exception, but got model: " + model);
253253
}, e -> {
254254
assertThat(e, instanceOf(ElasticsearchStatusException.class));
255-
assertThat(
256-
e.getMessage(),
257-
is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service")
258-
);
255+
assertThat(e.getMessage(), is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service"));
259256
});
260257

261258
service.parseRequestConfig("id", TaskType.TEXT_EMBEDDING, config, modelVerificationListener);
@@ -277,10 +274,7 @@ public void testParseRequestConfig_ThrowsWhenAnExtraKeyExistsInTaskSettingsMap()
277274
fail("Expected exception, but got model: " + model);
278275
}, e -> {
279276
assertThat(e, instanceOf(ElasticsearchStatusException.class));
280-
assertThat(
281-
e.getMessage(),
282-
is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service")
283-
);
277+
assertThat(e.getMessage(), is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service"));
284278
});
285279

286280
service.parseRequestConfig("id", TaskType.TEXT_EMBEDDING, config, modelVerificationListener);
@@ -302,10 +296,7 @@ public void testParseRequestConfig_ThrowsWhenAnExtraKeyExistsInSecretSettingsMap
302296
fail("Expected exception, but got model: " + model);
303297
}, e -> {
304298
assertThat(e, instanceOf(ElasticsearchStatusException.class));
305-
assertThat(
306-
e.getMessage(),
307-
is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service")
308-
);
299+
assertThat(e.getMessage(), is("Configuration contains settings [{extra_key=value}] unknown to the [azureopenai] service"));
309300
});
310301

311302
service.parseRequestConfig("id", TaskType.TEXT_EMBEDDING, config, modelVerificationListener);

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/deepseek/DeepSeekServiceTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ public void testParseRequestConfigWithExtraSettings() throws IOException {
146146
}
147147
""",
148148
assertNoSuccessListener(
149-
e -> assertThat(
150-
e.getMessage(),
151-
equalTo("Configuration contains settings [{so=extra}] unknown to the [deepseek] service")
152-
)
149+
e -> assertThat(e.getMessage(), equalTo("Configuration contains settings [{so=extra}] unknown to the [deepseek] service"))
153150
)
154151
);
155152
}

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/sagemaker/model/SageMakerModelBuilderTests.java

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -187,43 +187,35 @@ public void testFromRequestWithoutEndpointName() {
187187
}
188188

189189
public void testFromRequestWithExtraServiceKeys() {
190-
testExceptionFromRequest(
191-
"""
192-
{
193-
"service_settings": {
194-
"access_key": "test-access-key",
195-
"secret_key": "test-secret-key",
196-
"region": "us-east-1",
197-
"api": "test-api",
198-
"endpoint_name": "test-endpoint",
199-
"hello": "there"
200-
}
190+
testExceptionFromRequest("""
191+
{
192+
"service_settings": {
193+
"access_key": "test-access-key",
194+
"secret_key": "test-secret-key",
195+
"region": "us-east-1",
196+
"api": "test-api",
197+
"endpoint_name": "test-endpoint",
198+
"hello": "there"
201199
}
202-
""",
203-
ElasticsearchStatusException.class,
204-
"Configuration contains settings [{hello=there}] unknown to the [service] service"
205-
);
200+
}
201+
""", ElasticsearchStatusException.class, "Configuration contains settings [{hello=there}] unknown to the [service] service");
206202
}
207203

208204
public void testFromRequestWithExtraTaskKeys() {
209-
testExceptionFromRequest(
210-
"""
211-
{
212-
"service_settings": {
213-
"access_key": "test-access-key",
214-
"secret_key": "test-secret-key",
215-
"region": "us-east-1",
216-
"api": "test-api",
217-
"endpoint_name": "test-endpoint"
218-
},
219-
"task_settings": {
220-
"hello": "there"
221-
}
205+
testExceptionFromRequest("""
206+
{
207+
"service_settings": {
208+
"access_key": "test-access-key",
209+
"secret_key": "test-secret-key",
210+
"region": "us-east-1",
211+
"api": "test-api",
212+
"endpoint_name": "test-endpoint"
213+
},
214+
"task_settings": {
215+
"hello": "there"
222216
}
223-
""",
224-
ElasticsearchStatusException.class,
225-
"Configuration contains settings [{hello=there}] unknown to the [service] service"
226-
);
217+
}
218+
""", ElasticsearchStatusException.class, "Configuration contains settings [{hello=there}] unknown to the [service] service");
227219
}
228220

229221
public void testRoundTrip() throws IOException {

0 commit comments

Comments
 (0)