HappenLee commented on code in PR #62494:
URL: https://github.com/apache/doris/pull/62494#discussion_r3090617236


##########
be/src/exprs/function/ai/ai_adapter.h:
##########
@@ -872,13 +934,23 @@ class ZhipuAdapter : public OpenAIAdapter {
 
 class QwenAdapter : public OpenAIAdapter {
 public:
-    Status build_multimodal_embedding_request(MultimodalType media_type,
-                                              const std::string& media_url,
+    Status build_multimodal_embedding_request(const 
std::vector<MultimodalType>& media_types,
+                                              const std::vector<std::string>& 
media_urls,
                                               std::string& request_body) const 
override {
-        if (media_type != MultimodalType::IMAGE && media_type != 
MultimodalType::VIDEO) {
+        if (media_urls.empty()) {
+            return Status::InvalidArgument("QWEN multimodal embed inputs can 
not be empty");
+        }
+        if (media_types.size() != media_urls.size()) {
             return Status::InvalidArgument(
-                    "QWEN only supports image/video multimodal embed, got {}",
-                    multimodal_type_to_string(media_type));
+                    "QWEN multimodal embed input size mismatch, 
media_types={}, media_urls={}",
+                    media_types.size(), media_urls.size());
+        }
+        for (MultimodalType media_type : media_types) {
+            if (media_type != MultimodalType::IMAGE && media_type != 
MultimodalType::VIDEO) {

Review Comment:
   这些check都是一样的,应该统一抽象出来



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to