github-actions[bot] commented on code in PR #62494:
URL: https://github.com/apache/doris/pull/62494#discussion_r3083440268
##########
be/src/exprs/function/ai/embed.h:
##########
@@ -76,16 +76,42 @@ class FunctionEmbed : public AIFunction<FunctionEmbed> {
std::shared_ptr<AIAdapter>& adapter) const {
auto col_result = ColumnArray::create(
ColumnNullable::create(ColumnFloat32::create(),
ColumnUInt8::create()));
+ std::vector<std::string> batch_prompts;
Review Comment:
This batching change is not provider-safe for text embeddings. Before this
PR, `embed()` sent one prompt per request. Now `_flush_text_embedding_batch()`
calls `adapter->build_embedding_request(inputs, ...)` with `inputs.size() > 1`,
but `GeminiAdapter::build_embedding_request()` still builds a single `content`
object for the whole request and `parse_embedding_response()` still returns one
embedding on the text path.
Concrete failure path: use a GEMINI AI resource and run `select embed(...,
col) from t` over multiple rows. `_execute_prebuilt_embedding_request()`
expects one embedding per row, but Gemini text embedding will return only one
result here, so the new cardinality check trips.
Please either keep Gemini on the old single-row path or implement Gemini's
real batch text embedding request/response format before enabling this generic
batching.
--
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]