Conner
Conner2y ago

Text Components not rendering before API Call

Good afternoon VF. In one of my assistants, I have built out the following flow: 1) User presses "Check the News Agent" button 2) Assistant responds with back to back stacked text components, "I am a new AI Agent....blah blah blah" 3) POST request to 3rd party API that scrapes a few website URLs and formats data, which is stored in variable {AINews_report} 4) Our last text block that shows the contents of said variable and shows the user the report. Now this all works, which is great, but there's one problem. The 2 stacked texts components do not render at all as a response from the assistant until the POST Request finishes processing.
So from the user it's: 1. Click Button 2. ... ... ... ... ... ... ... ... ... (this API is slow) 3. 2 stacked text blocks + report all at once Why is this happening? The text blocks are clearly ahead of the API call and should immediately respond from the assistant.
Attached Picture of the designer with some of the surrounded paths/blocks greyed out
No description
6 Replies
Tico | Voiceflow Assistant
The behavior you're experiencing is due to the way Voiceflow processes blocks in a flow. When a user interacts with the assistant, Voiceflow executes all the blocks in a path until it reaches a block that requires user input or a block that inherently causes a delay, such as an API call. In your case, the two text blocks are followed by an API call. Voiceflow executes these blocks together, but the API call takes time to complete. While the API call is processing, the responses from the text blocks are held back. Once the API call is complete, all the responses (including the ones from the text blocks) are sent together to the user. To achieve the desired behavior, you can add a 'Pause' block between the text blocks and the API call. This will force Voiceflow to send the responses from the text blocks to the user before proceeding to the API call. The 'Pause' block can be set to a very short duration (e.g., 0.1 seconds) so it doesn't noticeably delay the conversation. Here's how you can modify your flow: 1. User presses "Check the News Agent" button 2. Assistant responds with back to back stacked text components, "I am a new AI Agent....blah blah blah" 3. Add a 'Pause' block with a short duration 4. POST request to 3rd party API that scrapes a few website URLs and formats data, which is stored in variable {AINews_report} 5. Our last text block that shows the contents of said variable and shows the user the report. This should ensure that the text blocks are rendered immediately after the user clicks the button, and the report is shown after the API call is complete.
Conner
ConnerOP2y ago
THIS BOT RULES 😄 @Daniel didn't you guys release on video on how you built Tico? I need to watch it. @Tico | Voiceflow Assistant how do I create a 'pause' block in voiceflow? how do i create a 'pause' block in voiceflow? hmmm was just seeing if I could summon Tico on command. Or is that just when the help post is generated?
W. Williams (SFT)
You can't "pause", but you could use a button step and have a Continue button.
protestant-coral
protestant-coral2y ago
Just when a post is generated! But @NiKo | Voiceflow maybe a cool feature to think about 👀
NiKo | Voiceflow
Indeed, multi turns is something we are working on for Tico on Discord.
NiKo | Voiceflow
For a pause (or to run and wait for a specific task to finish) you can also use Extensions. More details here: https://github.com/voiceflow-gallagan/vf-extensions-demo
GitHub
GitHub - voiceflow-gallagan/vf-extensions-demo
Contribute to voiceflow-gallagan/vf-extensions-demo development by creating an account on GitHub.

Did you find this page helpful?