This action within our chatbot allows the generation of text based on a stimulus and previous messages in the conversation. It can be applied to several scenarios, from classic chat-like interactions with an assistant to specific actions such as summarizing conversations for your agents, providing advice or detecting possible user behaviors. The effectiveness of the action largely depends on the quality of the stimulus provided.
Here are some explanations on how this action works and its limits :
1) The bot always executes this action synchronously, meaning it waits for the OpenAI API to return a response before moving on to the next step. Similar to the Webhook action , if you have multiple OpenAI actions in a row, they will execute sequentially rather than in batches.
2) The bot will continue its flow even if the OpenAI action fails viber database for some reason, such as a timeout.
3) It is your responsibility to handle the response, whether it is successful or not. You will need to specify variables to store OpenAI's response. It is then up to you to use these variables later in the bot, for example as conditions in an options block, in messages or notes.
How to get OpenAI API key and integrate it into Callbell chatbot on Telegram?
Now it's time to find the API key of our OpenAI so that we can integrate it into Callbell. We'll do this so that Callbell can communicate with OpenAI in conversations and then receive a response from them.
Note: Before you start setting up our AI chatbot, remember that you need to create a Callbell account ( you can create it by clicking here ) and connect Telegram to it (you can add Telegram to Callbell by clicking here ).
1) The first step we need to do to get the OpenAI API key is to log in to OpenAI and enter this link by clicking here.
2) Once inside, we will only have to click on the Create a new secret key button and this will give us a code that we must copy (this would be our key) .
3) Once the code is copied, we must go to our Callbell account and enter the chatbot with which we want to communicate with OpenAI, by clicking here and selecting the chatbot we want to configure.
4) Then in our chatbot builder, in the lower left corner, we will click on the box that has two parentheses and an x in the middle as a symbol, something like this (x) this field is called create variable .
Callbell Chatbot
5) Then, when we click on create variable, a box will appear in which we will have to enter the name of the variable, the type of variable (in this case we leave it as a string) and the secret key (API) that we copied from our account from OpenAI.
Note: This variable we created is the one we will place in the OpenAI token field when we create an OpenAI action in our chatbot.