https://discord.gg/botpress logo
#🌎general
Title
# 🌎general
s

steep-architect-15

07/01/2023, 2:53 PM
anyone know how to make it so when the knowledge base can't answer a question, it comes up with an error or a message telling them to rephrase their question?
e

early-train-33247

07/02/2023, 12:54 AM
Hey @steep-architect-15, you could check if the KB has responded with the expression
turn.KnowledgeAgent.responded === true
. Then you can transition to another node that let's them know there is no answer. Finally, in that node add a "always" transition to have make the bot go back to the capture
s

steep-architect-15

07/02/2023, 10:05 AM
Hi @early-train-33247 , thanks for the reply. Very much appreciated. Your guys support team is🔥 I've attached a coupe images to try to explain my problem here. If the KB is able to answer, the message from the 'no answer' node also appears. However when the KB can't answer it, only the 'no answer' message appears (which is good). Do you know how to make it so when the KB can answer, the 'no answer' message doesn't appear. Hopefully that makes sense
e

early-train-33247

07/02/2023, 9:34 PM
Can you show me what is the code for the first transition?
It seems that it always returns true and the transition is triggered
s

steep-architect-15

07/03/2023, 9:35 AM
It's weird as it only happens when it can answer the question from the KB
e

early-train-33247

07/04/2023, 12:54 AM
Hey @steep-architect-15 that is happening because that transition is always returning true
Please update it to
turn.KnowledgeAgent.answer === null
, and let me know if that helps
s

steep-architect-15

07/04/2023, 12:13 PM
Works like a charm
Appreciate that a lot @early-train-33247
e

early-train-33247

07/05/2023, 12:29 AM
Good to know @steep-architect-15! Happy building! 🚀