Yida Wu has uploaded a new patch set (#4). ( 
http://gerrit.cloudera.org:8080/22130 )

Change subject: IMPALA-13565: Add general AI platform support to 
ai_generate_text
......................................................................

IMPALA-13565: Add general AI platform support to ai_generate_text

Currently only open ai sites are allowed for ai_generate_text(),
this patch adds support for general AI platforms to
the ai_generate_text function. It introduces a new flag,
ai_api_additional_platforms, allowing Impala to access additional
AI platforms. For these general AI platforms, only the openai
standard is supported, and the default api credential serves as
the api token for general platforms.

The ai_api_key_jceks_secret parameter has been renamed to
auth_credential to support passing the plain text as a token.

A new impala_options parameter is added to ai_generate_text() to
enable future extensions. Adds the api_standard option to
impala_options, with "openai" as the only supported standard.
Adds the token_method option to impala_options for allowing
the plain text as the token, by default it is set to jceks.
Adds the payload option to impala_options for customized
payload input. If set, the request will use the provided
customized payload directly, and the response will follow the
openai standard for parsing. The customized payload size must not
exceed 5MB.

Example:
1. Add the site to ai_api_additional_platforms,like:
ai_api_additional_platforms='new_ai.site,new_ai.com'
2. Example sql:
select ai_generate_text("https://new_ai.com/v1/chat/completions";,
"hello", "model-name", "ai-api-token", "platform params",
'{"api_standard":"openai", "token_method":"plain",
"payload":"payload content"}}')

Tests:
Added a new test AiFunctionsTestAdditionalSites.
Manual tested the example with the Cloudera AI platform.
Passed core and asan tests.

Change-Id: I4ea2e1946089f262dda7ace73d5f7e37a5c98b14
---
M be/src/exprs/ai-functions-ir.cc
M be/src/exprs/ai-functions.h
M be/src/exprs/ai-functions.inline.h
M be/src/exprs/expr-test.cc
M be/src/udf/udf.cc
M be/src/udf/udf.h
6 files changed, 478 insertions(+), 141 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/22130/4
--
To view, visit http://gerrit.cloudera.org:8080/22130
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4ea2e1946089f262dda7ace73d5f7e37a5c98b14
Gerrit-Change-Number: 22130
Gerrit-PatchSet: 4
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Anonymous Coward (801)
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>

Reply via email to