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

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

IMPALA-13565: Add general AI 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_sites, 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 api token for general
platforms.

A new impala_options field is added in additional_params to
enable future extensions. Adds the api_standard option to
impala_options, with "openai" as the only supported standard.
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_sites,like:
ai_api_additional_sites='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", '{"temperature": 0.9,
"impala_options": {"api_standard":"openai",
"payload":"payload content"}}')

Tests:
Added a new test AiFunctionsTestAdditionalSites.
Manual tested the example with the Cloudera AI platform.

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, 387 insertions(+), 114 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/22130/2
--
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: 2
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>

Reply via email to