From 659a836775047e1d8f88a09eced7828d92e65d41 Mon Sep 17 00:00:00 2001 From: Austin Lee Date: Thu, 15 Aug 2024 08:29:25 -0700 Subject: [PATCH] Fix Cohere test. (#2831) Signed-off-by: Austin Lee --- .../opensearch/ml/rest/RestMLRAGSearchProcessorIT.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java index 125b96afc6..a7e3b9932a 100644 --- a/plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java +++ b/plugin/src/test/java/org/opensearch/ml/rest/RestMLRAGSearchProcessorIT.java @@ -149,7 +149,7 @@ public class RestMLRAGSearchProcessorIT extends RestMLRemoteInferenceIT { ? BEDROCK_CONNECTOR_BLUEPRINT2 : BEDROCK_CONNECTOR_BLUEPRINT1; - private static final String COHERE_API_KEY = System.getenv("COHERE_API_KEY"); + private static final String COHERE_KEY = System.getenv("COHERE_KEY"); private static final String COHERE_CONNECTOR_BLUEPRINT = "{\n" + " \"name\": \"Cohere Chat Model\",\n" + " \"description\": \"The connector to Cohere's public chat API\",\n" @@ -157,7 +157,7 @@ public class RestMLRAGSearchProcessorIT extends RestMLRemoteInferenceIT { + " \"protocol\": \"http\",\n" + " \"credential\": {\n" + " \"cohere_key\": \"" - + COHERE_API_KEY + + COHERE_KEY + "\"\n" + " },\n" + " \"parameters\": {\n" @@ -521,7 +521,7 @@ public void testBM25WithBedrockWithConversation() throws Exception { public void testBM25WithCohere() throws Exception { // Skip test if key is null - if (COHERE_API_KEY == null) { + if (COHERE_KEY == null) { return; } Response response = createConnector(COHERE_CONNECTOR_BLUEPRINT); @@ -573,7 +573,7 @@ public void testBM25WithCohere() throws Exception { public void testBM25WithCohereUsingLlmResponseField() throws Exception { // Skip test if key is null - if (COHERE_API_KEY == null) { + if (COHERE_KEY == null) { return; } Response response = createConnector(COHERE_CONNECTOR_BLUEPRINT); @@ -660,8 +660,6 @@ private Response performSearch(String indexName, String pipeline, int size, Sear requestParameters.match, requestParameters.llmModel, requestParameters.llmQuestion, - requestParameters.systemPrompt, - requestParameters.userInstructions, requestParameters.contextSize, requestParameters.interactionSize, requestParameters.timeout,