Also, is this : *__{{event.kb.results.map((a) => a...
# 🌎general
g
Also, is this : __{{event.kb.results.map((a) => a.dsFriendlyName + "\n" + a.content).join("\n\n")}}__ the only code that allows us to get data from the KB on an AI task
w
I don't use this code as it glitches for me sometime, I use query KB card and then pass it to the AI task
g
wait
I didn't think of doing that
so you are storing the result from the Query KB and using it as the AI task input ?
w
Yes, save the query answer in its own variable, give that variable to the AI task
that way I am always in the control 🙂
g
that's a great idea, and if everything works out, you're a genius 😄
w
Not a genius!
Was just experimenting like yourself a while back
g
@wide-oyster-38514 also, is it possible to make a certain card optional to answer without using a boolean that asks if you want to answer the question
w
What do you mean sorry?
g
For example, it is nice to have a phone number card, but I do not need the user's phone number (it's only optional)
But it's always better having a phone number (an additional way to contact the user)
w
Well, you can just use raw input if you don't need anything strict. If you use the phone number it will force the user to put one
Likewise with email, percentage etc.
g
alright
And what do you put in the input section ? Only the query KB variable or also the {{event.preview}} from a wait for user input card
w
event.preview is enough, if the comes directly after the user question
g
So it doesn't actually need @workflow.reponse in the AI task input section if I provide the @workflow.answer. Is it because a query knowledge base actually knows the answer stored in {{workflow.reponse}} ?
w
Yes just include the query KB answer variable
g
I'm not sure for the !turn.KnowledgeAgent.responded expression
what should I do if there are no valid answers in the KB ? Like what do I need to set up to send the user through an error node
@wide-oyster-38514
Uh is it the add transition to handle failure
Imma try that
Doesn't work
I found a code to put that might make things work out
w
Hey @glamorous-guitar-39983, 2 things
For query KB card you need to use different expression. You need: !turn.KnowledgeAgent.answer
So answer at the end, not responded
Secondly, you need to put that expression straught after the query KB card for it to work
g
Well what I did was different
I made 2 execute cards in the node, so each one checks If there has an answer in the workflow.query (where I store the answer from the QKB), If there is, store in the workflow.test "Works" If there isnt, store in the workflow.test "test"
Then I use an Ai transition for different path, and I add one more execute code to remove the answer in the workflow.query
20 Views