Skip to content

Commit

Permalink
Fix Cohere test. (#2831)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Lee <[email protected]>
  • Loading branch information
austintlee authored Aug 15, 2024
1 parent f64e3f3 commit 659a836
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ 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"
+ " \"version\": \"1\",\n"
+ " \"protocol\": \"http\",\n"
+ " \"credential\": {\n"
+ " \"cohere_key\": \""
+ COHERE_API_KEY
+ COHERE_KEY
+ "\"\n"
+ " },\n"
+ " \"parameters\": {\n"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 659a836

Please sign in to comment.