Abhishek Rawat has posted comments on this change. ( http://gerrit.cloudera.org:8080/21168 )
Change subject: IMPALA-12920: Support ai_generate_text built-in function for OpenAI's chat completion API ...................................................................... Patch Set 6: (4 comments) http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc File be/src/exprs/ai-functions-ir.cc: http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@83 PS5, Line 83: != nullptr); > nit. seems we can save one line here because above line has enough space This was suggested by clang to improve readability, I think. I'm inclined to keep it as is. http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@225 PS5, Line 225: kudu::EasyCurl curl; : curl.set_timeout(kudu::MonoDelta::FromSeconds(FLAGS_ai_connection_timeout_s)); : curl.set_fail_on_http_error(true); : kudu::faststring resp; : kudu::Status status = curl.PostToURL(endpoint_str, payload_str, &resp, headers); : VLOG(2) << "AI Generate Text: \noriginal response: " << resp.ToString(); : if (!status.ok()) { : string msg = status.ToString(); : return StringVal::CopyFrom( : ctx, reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size()); : } > Can we add a summary comment about what this part of code is doing? I think Done http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@236 PS5, Line 236: JSON respon > nit. how about saying "response JSON string" Done http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@251 PS5, Line 251: response > Thinking about whether we need to worry about the case when the length of r Some of that would be controlled by parameters such as max_tokens that you can set. https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens We also do have a limit of 1G on StringVals so anything bigger than that should return an error. https://github.com/apache/impala/blob/master/be/src/udf/udf.cc#L508 -- To view, visit http://gerrit.cloudera.org:8080/21168 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4446957f6030bab1f985fdd69185c3da07d7c4b Gerrit-Change-Number: 21168 Gerrit-PatchSet: 6 Gerrit-Owner: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]> Gerrit-Comment-Date: Tue, 02 Apr 2024 23:33:20 +0000 Gerrit-HasComments: Yes
