Yida Wu has uploaded this change for review. ( 
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.

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"}}')

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, 226 insertions(+), 51 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/30/22130/1
--
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: newchange
Gerrit-Change-Id: I4ea2e1946089f262dda7ace73d5f7e37a5c98b14
Gerrit-Change-Number: 22130
Gerrit-PatchSet: 1
Gerrit-Owner: Yida Wu <[email protected]>

Reply via email to