hello-stephen commented on code in PR #71438:
URL: https://github.com/apache/doris/pull/71438#discussion_r4811541435


##########
be/src/exprs/function/ai/embed.h:
##########
@@ -313,30 +380,42 @@ class FunctionEmbed : public AIFunction<FunctionEmbed> {
     }
 
     // EMBED-private helper.
-    // Flushes one accumulated multimodal embedding batch into the output 
array column.
-    Status _flush_multimodal_embedding_batch(std::vector<MultimodalType>& 
batch_media_types,
-                                             std::vector<std::string>& 
batch_media_content_types,
-                                             std::vector<std::string>& 
batch_media_urls,
-                                             ColumnArray& col_result, const 
AIResource& config,
-                                             std::shared_ptr<AIAdapter>& 
adapter,
-                                             FunctionContext* context) const {
-        if (batch_media_urls.empty()) {
+    // Flushes one accumulated multimodal or fused multimodal embedding batch 
into col_result.
+    Status _flush_multimodal_embedding_batch(
+            std::vector<std::vector<MultimodalInputItem>>& batch_inputs, bool 
is_fused,
+            ColumnArray& col_result, const AIResource& config, 
std::shared_ptr<AIAdapter>& adapter,
+            FunctionContext* context) const {
+        if (batch_inputs.empty()) {
             return Status::OK();
         }
 
         std::string request_body;
-        RETURN_IF_ERROR(adapter->build_multimodal_embedding_request(
-                batch_media_types, batch_media_urls, 
batch_media_content_types, request_body));
+        if (is_fused) {
+            RETURN_IF_ERROR(
+                    
adapter->build_fused_multimodal_embedding_request(batch_inputs, request_body));

Review Comment:
   [P2] Apply the model’s request limit when flushing fused rows. 
`embed_max_batch_size` accepts 21, and 21 valid text-and-image rows produce 21 
`input.contents` objects in one call. The Tongyi vision plus/flash 2026-03-06 
models that accept this grouped payload cap each request at 20 objects, so the 
provider can reject the whole batch. Limit the batch to the smaller of the 
session setting and the model cap, and cover a 21-row query that sends requests 
of 20 and 1. [Alibaba Cloud request 
limits](https://help.aliyun.com/en/model-studio/embedding)



-- 
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