diff --git a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java index a5f894b9072a7..c216535649d47 100644 --- a/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java +++ b/x-pack/plugin/inference/qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference/InferenceGetServicesIT.java @@ -20,7 +20,6 @@ import static org.elasticsearch.xpack.inference.InferenceBaseRestTest.assertStatusOkOrCreated; import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.equalTo; public class InferenceGetServicesIT extends BaseMockEISAuthServerTest { @@ -41,7 +40,6 @@ public void testGetServicesWithoutTaskType() throws IOException { "azureaistudio", "azureopenai", "cohere", - "custom", "deepseek", "elastic", "elasticsearch", @@ -77,9 +75,6 @@ private Iterable providers(List services) { } public void testGetServicesWithTextEmbeddingTaskType() throws IOException { - List services = getServices(TaskType.TEXT_EMBEDDING); - assertThat(services.size(), equalTo(18)); - assertThat( providersFor(TaskType.TEXT_EMBEDDING), containsInAnyOrder( @@ -90,7 +85,6 @@ public void testGetServicesWithTextEmbeddingTaskType() throws IOException { "azureaistudio", "azureopenai", "cohere", - "custom", "elastic", "elasticsearch", "googleaistudio", @@ -118,7 +112,6 @@ public void testGetServicesWithRerankTaskType() throws IOException { List.of( "alibabacloud-ai-search", "cohere", - "custom", "elasticsearch", "googlevertexai", "jinaai", @@ -133,10 +126,6 @@ public void testGetServicesWithRerankTaskType() throws IOException { } public void testGetServicesWithCompletionTaskType() throws IOException { - List services = getServices(TaskType.COMPLETION); - assertThat(services.size(), equalTo(17)); - var providers = providers(services); - assertThat( providersFor(TaskType.COMPLETION), containsInAnyOrder( @@ -147,7 +136,6 @@ public void testGetServicesWithCompletionTaskType() throws IOException { "azureaistudio", "azureopenai", "cohere", - "custom", "deepseek", "googleaistudio", "googlevertexai", @@ -188,7 +176,6 @@ public void testGetServicesWithSparseEmbeddingTaskType() throws IOException { containsInAnyOrder( List.of( "alibabacloud-ai-search", - "custom", "elastic", "elasticsearch", "hugging_face", diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomService.java index deb6e17ec5311..4a4166cf65ed3 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomService.java @@ -355,6 +355,12 @@ public TransportVersion getMinimalSupportedVersion() { return TransportVersions.INFERENCE_CUSTOM_SERVICE_ADDED; } + @Override + public boolean hideFromConfigurationApi() { + // The Custom service is very configurable so we're going to hide it from being exposed in the service API. + return true; + } + public static class Configuration { public static InferenceServiceConfiguration get() { return configuration.getOrCompute();