HappenLee commented on code in PR #55017:
URL: https://github.com/apache/doris/pull/55017#discussion_r2293008638
##########
be/src/vec/functions/llm/functions_llm.h:
##########
@@ -246,6 +285,36 @@ class LLMFunction : public IFunction {
result = results[0];
return Status::OK();
}
+
+ Status execute_single_request(const std::string& input,
std::vector<float>& result,
+ const TLLMResource& config,
std::shared_ptr<LLMAdapter>& adapter,
+ FunctionContext* context) const {
+ std::vector<std::string> inputs = {input};
+ std::vector<std::vector<float>> results;
+
+ std::string request_body;
+ RETURN_IF_ERROR(adapter->build_embedding_request(inputs,
request_body));
+
+ std::string response;
+ if (config.provider_type == "MOCK") {
+ // Mock path for UT
+ response = "{\"embedding\": [0, 1, 2, 3, 4]}";
+ } else {
+ RETURN_IF_ERROR(send_request_to_llm(request_body, response,
config, adapter, context));
+ }
+
+ Status status = adapter->parse_embedding_response(response, results);
Review Comment:
`RETURN_IF_ERROR(adapter->parse_embedding_response(response, results));`
--
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]