Skip to content

Commit 3d36017

Browse files
[ML] Removing custom service from service api (elastic#130739) (elastic#130767)
* Removing custom service from service api * Fixing tests (cherry picked from commit 02b2f5e) # Conflicts: # x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java
1 parent 6160281 commit 3d36017

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

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

Lines changed: 0 additions & 14 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",
@@ -112,19 +106,13 @@ private Iterable<String> providersFor(TaskType taskType) throws IOException {
112106
}
113107

114108
public void testGetServicesWithRerankTaskType() throws IOException {
115-
List<Object> services = getServices(TaskType.RERANK);
116-
assertThat(services.size(), equalTo(11));
117-
118-
var providers = providers(services);
119-
120109
assertThat(
121110
providersFor(TaskType.RERANK),
122111
containsInAnyOrder(
123112
List.of(
124113
"alibabacloud-ai-search",
125114
"amazon_sagemaker",
126115
"cohere",
127-
"custom",
128116
"elastic",
129117
"elasticsearch",
130118
"googlevertexai",
@@ -148,7 +136,6 @@ public void testGetServicesWithCompletionTaskType() throws IOException {
148136
"azureaistudio",
149137
"azureopenai",
150138
"cohere",
151-
"custom",
152139
"deepseek",
153140
"googleaistudio",
154141
"openai",
@@ -187,7 +174,6 @@ public void testGetServicesWithSparseEmbeddingTaskType() throws IOException {
187174
containsInAnyOrder(
188175
List.of(
189176
"alibabacloud-ai-search",
190-
"custom",
191177
"elastic",
192178
"elasticsearch",
193179
"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_8_19;
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)