Problem following "How to build an AI chatbot: ste...
# 🤝help
e
• Your objective or what you aim to achieve: I'm new to chatbots, and was following this youtube tutorial as a start. • The issues you’re encountering: When testing on the emulator, the conversation stops before it should. The bot asks "how many people are joining the plan?", and, after getting the answer, it crashes. It should continue giving plan recommendations. • The solutions you’ve already attempted: I've followed all the steps, and checked many times I've done everything as the video shows. I've added a translator agent because the conversations between chatbot and user are intented to be in Spanish. Can anybody help me? Thank you in advance, Marián
b
this might be happening because the user input is now a number
try just 7 instead of somos 7
e
I see! It works now, thank you. Is there a simple way to make it work with an answer like "somos 7", tho?
f
What do you have in your expression cards?
e
Sorry for the late response, I just saw this. This is what I have: user input is a number between 1 and 5 user input is a number between 6 and 10 user input is a number higher than 11
f
No worries at all What code did it generate?
Does the capture information card "num_people" save it to a string variable or number variable?
e
The code: !isNaN(parseInt(event.preview)) && parseInt(event.preview) >= 1 && parseInt(event.preview) <= 5
!isNaN(Number(event.preview)) && Number(event.preview) >= 6 && Number(event.preview) <= 10
!isNaN(Number(event.preview)) && Number(event.preview) > 11
And number variable, I believe
Thank you so much for your help
f
You don't want to use event.preview
That will always be a string
Use the variable that you saved the users input from in the capture information card
the one that is a number
Not sure if parseInt works in the expression card
e
Sorry, I'm new to coding. Should I delete "event.preview" and write the name of my variable instead in the code?
f
Yeah, just replace event.preview with the variable name
e
I see, thank you!
f
You are very welcome! Let me know if it works
2 Views