The OpenAI AI connector enables you to connect the AI models served on the OpenAI Platform for the following tasks:
#Release Stage
Alpha
#Resource Configuration
The up-to-date configuration is maintained here.
Field | Type | Note |
---|---|---|
api_key* | string | Enter your OpenAI API key. To find your keys, go to your OpenAI's Account page. |
#No-code Setup
To create a OpenAI AI connector, you'll first need to create a OpenAI account by visiting openai.com. Access to your API keys can then be managed through OpenAI's Account page.
To create a OpenAI AI connector:
-
Go to the AI page and click Set up new AI
-
In the Set Up New AI Connector page, fill an ID for your model, this will be the unique identifier of this connector
-
[Optional] Give a short description of your connector in the Description field
-
Click the AI Connector Type ▾ drop-down and choose OpenAI
-
Fill the following information and click Set up
- Fill API Key. Follow the OpenAI documentation to find your API key
-
By default, the connector is disconnected. To connect and use AI connector, go to the connector page and click Connect.
#Low-code Setup
For other operations, please refer to the VDP Protobufs.
#Connector Configuration
When using the OpenAI AI connector in your pipeline, certain fields of the input data need to be filled to trigger the pipeline effectively. Here are the expected input and output data fields for the OpenAI AI connector.
#Text Generation
If task
is set to TASK_TEXT_GENERATION
Input | Type | Description |
---|---|---|
task | string | TASK_TEXT_GENERATION |
prompt | string | Text prompt |
model | string | The model that you want to use. eg., gpt-4 and gpt-3.5-turbo . |
system_message | string | The system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model's behavior is using a generic message as "You are a helpful assistant." |
temperature | float | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. |
n | int | How many chat completion choices to generate for each input message. |
max_tokens | int | The maximum number of tokens to generate in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. Example Python code for counting tokens. |
Output | Type | Description |
---|---|---|
texts | array[string] | Generated text array |
#Text Embeddings
Input | Type | Description |
---|---|---|
task | string | TASK_TEXT_EMBEDDINGS |
text | string | Text to be converted to dense vector |
model | string | The model that you want to use. eg. text-embedding-ada-002 |
Output | Type | Description |
---|---|---|
embedding | array[float] | A vector embeddings |
#Speech Recognition
Input | Type | Description |
---|---|---|
task | string | TASK_SPEECH_RECOGNITION |
model | string | The model that you want to use, e.g., whisper-1 . |
audio | string | Base64 encoded audio recording to transcribe |
temperature | float | The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit. |
language | string | The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency. |
prompt | string | An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. |
Output | Type | Description |
---|---|---|
text | string | Transcribed text |
#Example
Example input and output data for each task: