OpenAI Node
The OpenAI node is used to integrate OpenAI into fabella.
When you click on a OpenAI node you will be presented with various fields. In Prompt you can type in the text you want to send to OpenAI. In the field Text Output you have to name the variable in which the entire response will be stored. Max Tokens sets the number of tokens send to OpenAI. The API Key is obtained from OpenAI.
OpenAI Node | |
---|---|
Prompt | The Prompt to OpenAI. |
Text Output | When OpenAI gives back an response, the entire response will be stored in the this variable. |
Max Tokens | Max Tokens send to OpenAI. |
API Key | API Key obtained from OpenAI. |
Using the response data
The response data is saved in the variable you indicated. The content of the variable will contain the exact response as raw text.
Obtaining API Key
To get an OpenAI API key, you'll need to create an account first.
To get your API key, follow these steps:
- Navigate to platform openai
- Click on your avatar in the top right-hand corner of the dashboard.
- Select View API Keys.
- Click Create new secret key.
The key will only be shown once, so make sure you copy it and save it somewhere safe.
Now you can easily copy your API Key into the OpenAI node.
Use example
An example that lets the user speak the prompt:
-
Check No match and capture input in the Hear node to capture the utterance in a variable (named prompt in this case).
-
Use the variable in the Prompt field in the “Open AI” node. Then add a variable to the Text Output field to capture the result.
-
Use the Text Output variable in the next Say node.