Skip to content

Commit dfb375a

Browse files
committed
Correction after test
Signed-off-by: Sicheng Song <sicheng.song@outlook.com>
1 parent ac323fa commit dfb375a

File tree

1 file changed

+3
-91
lines changed

1 file changed

+3
-91
lines changed

common/src/main/java/org/opensearch/ml/common/utils/ModelInterfaceUtils.java

+3-91
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public class ModelInterfaceUtils {
481481
+ " \"required\": [\"inference_results\"]\n"
482482
+ "}";
483483

484-
private static final String COHERE_EMBED_MULTILINGUAL_V3_RAW_INTERFACE_OUTPUT = "{\n"
484+
private static final String COHERE_EMBEDDING_V3_RAW_INTERFACE_OUTPUT = "{\n"
485485
+ " \"type\": \"object\",\n"
486486
+ " \"properties\": {\n"
487487
+ " \"inference_results\": {\n"
@@ -539,94 +539,6 @@ public class ModelInterfaceUtils {
539539
+ " \"required\": [\"inference_results\"]\n"
540540
+ "}";
541541

542-
private static final String COHERE_EMBED_ENGLISH_V3_RAW_INTERFACE_OUTPUT = "{\n"
543-
+ " \"type\": \"object\",\n"
544-
+ " \"properties\": {\n"
545-
+ " \"inference_results\": {\n"
546-
+ " \"type\": \"array\",\n"
547-
+ " \"items\": {\n"
548-
+ " \"type\": \"object\",\n"
549-
+ " \"properties\": {\n"
550-
+ " \"output\": {\n"
551-
+ " \"type\": \"array\",\n"
552-
+ " \"items\": {\n"
553-
+ " \"type\": \"object\",\n"
554-
+ " \"properties\": {\n"
555-
+ " \"name\": {\n"
556-
+ " \"type\": \"string\"\n"
557-
+ " },\n"
558-
+ " \"dataAsMap\": {\n"
559-
+ " \"type\": \"object\",\n"
560-
+ " \"properties\": {\n"
561-
+ " \"id\": {\n"
562-
+ " \"type\": \"string\"\n"
563-
+ " },\n"
564-
+ " \"results\": {\n"
565-
+ " \"type\": \"array\",\n"
566-
+ " \"items\": {\n"
567-
+ " \"type\": \"object\",\n"
568-
+ " \"properties\": {\n"
569-
+ " \"document\": {\n"
570-
+ " \"type\": \"object\",\n"
571-
+ " \"properties\": {\n"
572-
+ " \"text\": {\n"
573-
+ " \"type\": \"string\"\n"
574-
+ " }\n"
575-
+ " },\n"
576-
+ " \"required\": [\"text\"]\n"
577-
+ " },\n"
578-
+ " \"index\": {\n"
579-
+ " \"type\": \"integer\"\n"
580-
+ " },\n"
581-
+ " \"relevance_score\": {\n"
582-
+ " \"type\": \"number\"\n"
583-
+ " }\n"
584-
+ " },\n"
585-
+ " \"required\": [\"document\", \"index\", \"relevance_score\"]\n"
586-
+ " }\n"
587-
+ " },\n"
588-
+ " \"meta\": {\n"
589-
+ " \"type\": \"object\",\n"
590-
+ " \"properties\": {\n"
591-
+ " \"api_version\": {\n"
592-
+ " \"type\": \"object\",\n"
593-
+ " \"properties\": {\n"
594-
+ " \"version\": {\n"
595-
+ " \"type\": \"string\"\n"
596-
+ " }\n"
597-
+ " },\n"
598-
+ " \"required\": [\"version\"]\n"
599-
+ " },\n"
600-
+ " \"billed_units\": {\n"
601-
+ " \"type\": \"object\",\n"
602-
+ " \"properties\": {\n"
603-
+ " \"search_units\": {\n"
604-
+ " \"type\": \"integer\"\n"
605-
+ " }\n"
606-
+ " },\n"
607-
+ " \"required\": [\"search_units\"]\n"
608-
+ " }\n"
609-
+ " },\n"
610-
+ " \"required\": [\"api_version\", \"billed_units\"]\n"
611-
+ " }\n"
612-
+ " },\n"
613-
+ " \"required\": [\"id\", \"results\", \"meta\"]\n"
614-
+ " }\n"
615-
+ " },\n"
616-
+ " \"required\": [\"name\", \"dataAsMap\"]\n"
617-
+ " }\n"
618-
+ " },\n"
619-
+ " \"status_code\": {\n"
620-
+ " \"type\": \"integer\"\n"
621-
+ " }\n"
622-
+ " },\n"
623-
+ " \"required\": [\"output\", \"status_code\"]\n"
624-
+ " }\n"
625-
+ " }\n"
626-
+ " },\n"
627-
+ " \"required\": [\"inference_results\"]\n"
628-
+ "}";
629-
630542
private static final String AMAZON_COMPREHEND_DETECTDOMAINANTLANGUAGE_API_INTERFACE_OUTPUT = "{\n"
631543
+ " \"type\": \"object\",\n"
632544
+ " \"properties\": {\n"
@@ -827,13 +739,13 @@ public class ModelInterfaceUtils {
827739
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", GENERAL_EMBEDDING_MODEL_INTERFACE_OUTPUT);
828740

829741
public static final Map<String, String> BEDROCK_COHERE_EMBED_ENGLISH_V3_RAW_MODEL_INTERFACE = Map
830-
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", COHERE_EMBED_ENGLISH_V3_RAW_INTERFACE_OUTPUT);
742+
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", COHERE_EMBEDDING_V3_RAW_INTERFACE_OUTPUT);
831743

832744
public static final Map<String, String> BEDROCK_COHERE_EMBED_MULTILINGUAL_V3_MODEL_INTERFACE = Map
833745
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", GENERAL_EMBEDDING_MODEL_INTERFACE_OUTPUT);
834746

835747
public static final Map<String, String> BEDROCK_COHERE_EMBED_MULTILINGUAL_V3_RAW_MODEL_INTERFACE = Map
836-
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", COHERE_EMBED_MULTILINGUAL_V3_RAW_INTERFACE_OUTPUT);
748+
.of("input", GENERAL_EMBEDDING_MODEL_INTERFACE_INPUT, "output", COHERE_EMBEDDING_V3_RAW_INTERFACE_OUTPUT);
837749

838750
public static final Map<String, String> BEDROCK_TITAN_EMBED_TEXT_V1_MODEL_INTERFACE = Map
839751
.of("input", TITAN_TEXT_EMBEDDING_MODEL_INTERFACE_INPUT, "output", GENERAL_EMBEDDING_MODEL_INTERFACE_OUTPUT);

0 commit comments

Comments
 (0)