|
89 | 89 | import static org.elasticsearch.xpack.inference.services.ServiceComponentsTests.createWithEmptySettings; |
90 | 90 | import static org.elasticsearch.xpack.inference.services.llama.completion.LlamaChatCompletionModelTests.createChatCompletionModel; |
91 | 91 | import static org.elasticsearch.xpack.inference.services.llama.completion.LlamaChatCompletionServiceSettingsTests.getServiceSettingsMap; |
92 | | -import static org.elasticsearch.xpack.inference.services.llama.embeddings.LlamaEmbeddingsServiceSettingsTests.buildServiceSettingsMap; |
93 | 92 | import static org.elasticsearch.xpack.inference.services.settings.DefaultSecretSettingsTests.getSecretSettingsMap; |
94 | 93 | import static org.hamcrest.CoreMatchers.is; |
95 | 94 | import static org.hamcrest.Matchers.equalTo; |
@@ -627,28 +626,6 @@ public void testSupportsStreaming() throws IOException { |
627 | 626 | } |
628 | 627 | } |
629 | 628 |
|
630 | | - public void testParseRequestConfig_ThrowsWhenAnExtraKeyExistsInEmbeddingSecretSettingsMap() throws IOException { |
631 | | - try (var service = createService()) { |
632 | | - var secretSettings = getSecretSettingsMap("secret"); |
633 | | - secretSettings.put("extra_key", "value"); |
634 | | - |
635 | | - var config = getRequestConfigMap(getEmbeddingsServiceSettingsMap(), secretSettings); |
636 | | - |
637 | | - ActionListener<Model> modelVerificationListener = ActionListener.wrap( |
638 | | - model -> fail("Expected exception, but got model: " + model), |
639 | | - exception -> { |
640 | | - assertThat(exception, instanceOf(ElasticsearchStatusException.class)); |
641 | | - assertThat( |
642 | | - exception.getMessage(), |
643 | | - is("Configuration contains settings [{extra_key=value}] unknown to the [llama] service") |
644 | | - ); |
645 | | - } |
646 | | - ); |
647 | | - |
648 | | - service.parseRequestConfig("id", TaskType.TEXT_EMBEDDING, config, modelVerificationListener); |
649 | | - } |
650 | | - } |
651 | | - |
652 | 629 | public void testChunkedInfer_ChunkingSettingsNotSet() throws IOException { |
653 | 630 | var model = LlamaEmbeddingsModelTests.createEmbeddingsModel("id", "url", "api_key", "user", null, false); |
654 | 631 | model.setURI(getUrl(webServer)); |
@@ -858,8 +835,4 @@ private Map<String, Object> getRequestConfigMap(Map<String, Object> serviceSetti |
858 | 835 |
|
859 | 836 | return new HashMap<>(Map.of(ModelConfigurations.SERVICE_SETTINGS, builtServiceSettings)); |
860 | 837 | } |
861 | | - |
862 | | - private static Map<String, Object> getEmbeddingsServiceSettingsMap() { |
863 | | - return buildServiceSettingsMap("id", "url", SimilarityMeasure.COSINE.toString(), null, null, null, null); |
864 | | - } |
865 | 838 | } |
0 commit comments