[ 
https://issues.apache.org/jira/browse/FLINK-39266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066677#comment-18066677
 ] 

Cong Cheng commented on FLINK-39266:
------------------------------------

It's already supported in our internal version, I'd like to take it.

> Support metadata column in sql create model ddl
> -----------------------------------------------
>
>                 Key: FLINK-39266
>                 URL: https://issues.apache.org/jira/browse/FLINK-39266
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 2.2.0, 2.3.0
>            Reporter: Cong Cheng
>            Priority: Major
>
> h3. Description
> Currently, sql create model ddl with metadata column is not supported, 
> whereas it's an important way to catch exception and expose error information 
> with metadata columns, such as there are [metadata 
> columns|https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/models/openai/#available-metadata]
>  (error-string, http-status-code and http-headers-map) supported by OpenAI 
> model.
> h3. Steps to Reproduce
>  * Create a model with sql:
> {code:sql}
> CREATE MODEL ai_analyze_sentiment
> INPUT (`input` STRING)
> OUTPUT (`content` STRING, `error-string` STRING METADATA VIRTUAL)
> WITH (
>     'provider'='openai',
>     'endpoint'='https://api.openai.com/v1/chat/completions',
>     'api-key' = '<YOUR KEY>',
>     'model'='gpt-3.5-turbo',
>     'system-prompt' = 'xx'
> );
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to