Skip to content

Commit 02b2f5e

Browse files
[ML] Removing custom service from service api (elastic#130739)
* Removing custom service from service api * Fixing tests
1 parent 6d81ff9 commit 02b2f5e

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

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

Lines changed: 0 additions & 13 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",
@@ -133,10 +126,6 @@ public void testGetServicesWithRerankTaskType() throws IOException {
133126
}
134127

135128
public void testGetServicesWithCompletionTaskType() throws IOException {
136-
List<Object> services = getServices(TaskType.COMPLETION);
137-
assertThat(services.size(), equalTo(17));
138-
var providers = providers(services);
139-
140129
assertThat(
141130
providersFor(TaskType.COMPLETION),
142131
containsInAnyOrder(
@@ -147,7 +136,6 @@ public void testGetServicesWithCompletionTaskType() throws IOException {
147136
"azureaistudio",
148137
"azureopenai",
149138
"cohere",
150-
"custom",
151139
"deepseek",
152140
"googleaistudio",
153141
"googlevertexai",
@@ -188,7 +176,6 @@ public void testGetServicesWithSparseEmbeddingTaskType() throws IOException {
188176
containsInAnyOrder(
189177
List.of(
190178
"alibabacloud-ai-search",
191-
"custom",
192179
"elastic",
193180
"elasticsearch",
194181
"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)