stormy-gold•3mo ago
Help a newbie build logic?
I want the bot to take an action (offer coaching to users and request name and email) after the user asks 5 questions of the chatbot. I believe I created the prompt with a capture of the user name and email and created an action prompt but after testing did not get the desired result. I attended a Voiceflow office hour yesterday but we didn't have time to really help me with my question. Steven (who was awesome) suggested I could set up something called a "Question Count" where I could tell the tool that when Question = 1 to proceed, when Question = 2 to proceed, etc., until we get to Question = 5 to have it use the prompt that offers coaching. I don't know how to build that. I would love some help! Please see screenshot of what I have thus far.

5 Replies
Hey @Michelle, I'll pick up where we left off 🙂
You need to set a variable e.g counter to increment, you can do this like this.
First get a 'Set' step from the Logic menu, select your variable and choose expression, then ass this code
Number(counter || 0) + 1;
like in image one.
Next, get a 'Condition' step from the logic menu, select your counter variable and set it to the amount of counts you want.
You can use the count variable in a prompt step to get the LLM to do what you need like ask certain questions based on the number count etc... hope that helps!

stormy-goldOP•3mo ago
Thank you so much @Steve B. | IntelleSync.ai I am working on this now 🙂 When I am making the last piece (using the count variable in a prompt step), what does this mean - add conversation history or add message pair - at the lower part of my screenshot?

@Michelle You don't need to worry about those in your scenario but adding conversation history never hurt. When thats selected the prompt step will use Voiceflows memory variable {vf_memory} in the background to understand the context of the conversation. Message pairs are used to provide examples of conversations to the LLM so it knows how to respond but I would say that's better for nuanced scenarios as LLMs are pretty clever these days.
stormy-goldOP•3mo ago
So I tested it and it did not work. I wonder if the reason is that I did not "connect" the Chat bot to the beginning of my process flow called "New Block 5" on my diagram. What should I do?

Thats right, also the agent step isn't what you need. You need a setup like illustrated in my screenshot. check your dm.
