I’d like to create a ChatGPT chatbot with Alexa. I am using the following Voiceflow logic but the skill cannot remember previous correspondence as the loop gets only the API response over and over. Is there a guide to how I can build this to function properly?
Hi Rony it seems that by “previous correspondences” you are refering to the lack of memory (as in: it seems as if the bot doesent keep the conversation going). Is that what you are refering to? If so, what you need to do is to create a code block to manipulate your request body each time you get a new response to include the previous dialogs in your new request.
Thank you for the reply, jalq. You are correct, I’d like to keep the conversation going.
I understand! Thank you, seems like I need to call for another user content and then input the API output into the assistant content for the next call. I’d have to create multiple API calls with increasing numbers of user and assistant inputs. Is there no easier way heh?
Nope…this is just how the OpenAI API works to keep the conversation going. Build your request body dynamically on each new interaction and submit the new body everytime. This only works for GPT3.5 and up. For GPT3 you have to add the history directly in the prompt. Good luck!
I tested by first telling it my name was Ron, then when I asked it what my name was for question 2 it didn’t know. Seems like I failed to have it recall previous communications.
I can provide some general possibilities as to why a second API call may not keep previous correspondence in its reply.
The API is not designed to maintain conversation threads: Some APIs are designed to provide a one-time response to a query and do not keep track of previous interactions. In this case, the API would not provide any contextual information in its reply.
The API does not have access to previous correspondence: The second API call may be made by a different application or service that does not have access to the previous conversation history. Without this context, the API may not include previous correspondence in its response.
The API requires specific parameters to maintain conversation threads: Some APIs may require specific parameters, such as conversation IDs or tokens, to maintain conversation threads. If these parameters are not included in the second API call, the API may not be able to identify the conversation thread and include previous correspondence in its reply.
The API is programmed to provide only relevant information: Some APIs are designed to provide only the most relevant information in their responses. In this case, including previous correspondence may not be relevant to the current query and may be excluded from the response.
Overall, the specific reason why a second API call may not keep previous correspondence in its reply will depend on the API’s design and the context in which it is being used. To learn more about our API search online, click here to visit our website.