10
10
import java .nio .file .Path ;
11
11
import java .util .List ;
12
12
import java .util .Map ;
13
- import java .util .Optional ;
14
13
15
14
import org .apache .commons .lang3 .StringUtils ;
16
15
import org .junit .Before ;
19
18
import org .opensearch .ml .common .input .MLInput ;
20
19
21
20
public class RestCohereInferenceIT extends MLCommonsRestTestCase {
22
- private final String COHERE_KEY = Optional . ofNullable ( System .getenv ("COHERE_KEY" )). orElse ( "UzRF34a6gj0OKkvHOO6FZxLItv8CNpK5dFdCaUDW " );
21
+ private final String COHERE_KEY = System .getenv ("COHERE_KEY" );
23
22
private final Map <String , String > DATA_TYPE = Map
24
23
.of (
25
24
"connector.post_process.cohere_v2.embedding.float" ,
@@ -29,17 +28,14 @@ public class RestCohereInferenceIT extends MLCommonsRestTestCase {
29
28
"connector.post_process.cohere_v2.embedding.uint8" ,
30
29
"UINT8" ,
31
30
"connector.post_process.cohere_v2.embedding.binary" ,
32
- "BINARY" ,
33
- "connector.post_process.cohere_v2.embedding.ubinary" ,
34
- "UBINARY"
31
+ "BINARY"
35
32
);
36
33
private final List <String > POST_PROCESS_FUNCTIONS = List
37
34
.of (
38
35
"connector.post_process.cohere_v2.embedding.float" ,
39
36
"connector.post_process.cohere_v2.embedding.int8" ,
40
37
"connector.post_process.cohere_v2.embedding.uint8" ,
41
- "connector.post_process.cohere_v2.embedding.binary" ,
42
- "connector.post_process.cohere_v2.embedding.ubinary"
38
+ "connector.post_process.cohere_v2.embedding.binary"
43
39
);
44
40
45
41
@ Before
@@ -48,6 +44,10 @@ public void setup() throws IOException {
48
44
}
49
45
50
46
public void test_cohereInference_withDifferent_postProcessFunction () throws URISyntaxException , IOException , InterruptedException {
47
+ // Skip test if key is null
48
+ if (COHERE_KEY == null ) {
49
+ return ;
50
+ }
51
51
String templates = Files
52
52
.readString (
53
53
Path
0 commit comments