Skip to content

Commit 178f871

Browse files
[ML] Removing custom service from service api (#130739)
* Removing custom service from service api * Fixing tests
1 parent 7d73c04 commit 178f871

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import static org.elasticsearch.xpack.inference.InferenceBaseRestTest.assertStatusOkOrCreated;
2222
import static org.hamcrest.Matchers.containsInAnyOrder;
23-
import static org.hamcrest.Matchers.equalTo;
2423

2524
public class InferenceGetServicesIT extends BaseMockEISAuthServerTest {
2625

@@ -41,7 +40,6 @@ public void testGetServicesWithoutTaskType() throws IOException {
4140
"azureaistudio",
4241
"azureopenai",
4342
"cohere",
44-
"custom",
4543
"deepseek",
4644
"elastic",
4745
"elasticsearch",
@@ -77,9 +75,6 @@ private Iterable<String> providers(List<Object> services) {
7775
}
7876

7977
public void testGetServicesWithTextEmbeddingTaskType() throws IOException {
80-
List<Object> services = getServices(TaskType.TEXT_EMBEDDING);
81-
assertThat(services.size(), equalTo(18));
82-
8378
assertThat(
8479
providersFor(TaskType.TEXT_EMBEDDING),
8580
containsInAnyOrder(
@@ -90,7 +85,6 @@ public void testGetServicesWithTextEmbeddingTaskType() throws IOException {
9085
"azureaistudio",
9186
"azureopenai",
9287
"cohere",
93-
"custom",
9488
"elastic",
9589
"elasticsearch",
9690
"googleaistudio",
@@ -118,7 +112,6 @@ public void testGetServicesWithRerankTaskType() throws IOException {
118112
List.of(
119113
"alibabacloud-ai-search",
120114
"cohere",
121-
"custom",
122115
"elasticsearch",
123116
"googlevertexai",
124117
"jinaai",
@@ -143,7 +136,6 @@ public void testGetServicesWithCompletionTaskType() throws IOException {
143136
"azureaistudio",
144137
"azureopenai",
145138
"cohere",
146-
"custom",
147139
"deepseek",
148140
"googleaistudio",
149141
"openai",
@@ -181,7 +173,6 @@ public void testGetServicesWithSparseEmbeddingTaskType() throws IOException {
181173
containsInAnyOrder(
182174
List.of(
183175
"alibabacloud-ai-search",
184-
"custom",
185176
"elastic",
186177
"elasticsearch",
187178
"hugging_face",

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,12 @@ public TransportVersion getMinimalSupportedVersion() {
355355
return TransportVersions.INFERENCE_CUSTOM_SERVICE_ADDED;
356356
}
357357

358+
@Override
359+
public boolean hideFromConfigurationApi() {
360+
// The Custom service is very configurable so we're going to hide it from being exposed in the service API.
361+
return true;
362+
}
363+
358364
public static class Configuration {
359365
public static InferenceServiceConfiguration get() {
360366
return configuration.getOrCompute();

0 commit comments

Comments
 (0)