-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[FLINK-37799][model][docs] Add document for OpenAI Model Function #26671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FLINK-37799][model][docs] Add document for OpenAI Model Function #26671
Conversation
|
||
# OpenAI | ||
|
||
The OpenAI Model Function allows Flink SQL to call OpenAI API for inference tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a link to the OpenAI javadoc on the words OpenAI API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment! I've add the link.
|
||
The function supports calling remote OpenAI model services via Flink SQL for prediction/inference tasks. Currently, the following tasks are supported: | ||
|
||
* chat completions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there needs to be more information about these 2 tasks, and why we are restricted to these tasks?
It would be good to include links to what these mean,
https://platform.openai.com/docs/api-reference/chat
https://platform.openai.com/docs/api-reference/embeddings
|
||
## Usage examples | ||
|
||
The following example creates a chat completions model and use it to predict sentiment labels for movie reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use -> uses
WITH ( | ||
'provider'='openai', | ||
'endpoint'='https://api.openai.com/v1/chat/completions', | ||
'api-key' = '<YOUR KEY>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we define <YOUR KEY>.
<td>required</td> | ||
<td style="word-wrap: break-word;">(none)</td> | ||
<td>String</td> | ||
<td>Full URL of the OpenAI API endpoint, e.g., <code>https://api.openai.com/v1/chat/completions</code> or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: e.g., -> e.g.
</tbody> | ||
</table> | ||
|
||
### chat/completions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chat/completions is different to chat completions
that we mentioned earlier as a task. I suggest being consistent.
<td>optional</td> | ||
<td style="word-wrap: break-word;">"You are a helpful assistant."</td> | ||
<td>String</td> | ||
<td>System message for chat tasks.</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to point into the OpenAI docs as to what this and the other parameters mean. I notice we use the phrase system-prompt an System message, I suggest we define one and point to it an only use one way to refer to this. When we say system here - do we mean system role?
What is the purpose of the change
This PR is a continuation to #26652, adding document for the introduced OpenAI Model Function.
Brief change log
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation