Bot repeats "question" input if conversation doesn...
# 🤝help
p
Would love help on this - I'm using a knowledge base chatbot (image supplied). If I ask a question instead of a "hey" as the initial message to the chatbot, it answers with the knowledge base, but then repeats the question capture information text. However, If I start the conversation with "hey" and then proceed to ask a question, it does not do this. How do I make the bot flexible so that if someone asks a question as the first message, it just answers the question and does not repeat the "question" capture info"
a
Hey @powerful-helicopter-39371, you can try making a transition at the top of your "Check knowledge" node with this code:
!event.state.agentVariables.KnowledgeAgent.turn.responded
. event.....responsed will be
true
if there was an answer from the Knowledge base, and the
!
reverses that so this transition will only kick off if there was not an answer. This transition can then lead to your capture info card.
p
hey Gordy thanks for this! Is where my red arrow the correct place for the transiton?
Do I need to have another card then? For example a greeting card that says "hey blah blah" and another one that says "what can I help you with" and is the question input? or is it fine having it all in one node like I have
a
No, you need to add a new "Expression" transition card
p
Okay thanks, and that connects to the "END" node?
a
sure. It connects wherever you want to go after the bot doesn't answer a question from the KB
p
@acceptable-kangaroo-64719 , didn't seem to work unfortunetly. When I typed "hey" it immedietly ended the conversation and when I asked a question related to the KB, it stated the correct answer then repeated the question like before
a
It's working as designed, our expectations are just misaligned. Right now the transtion will fire if the bot doesn't have an answer (such as when you say hey). If the bot does have an answer, it'll ask the question
You can change this behavior by removing the
!
at the start of the expression
p
Thanks for that Gordy, makes sense. Just another quick one, how would I make the bot say a different text if the bot answers from the KB? For example if it answers the question from the KB, it can then say, do you have any more questions?
a
You can make a new node and put that question in the new node. Then link your transition (without the
!
) to that new node.
20 Views