Greetings, Botpress Friends 🖐️
I've embarked on a journey with Botpress and recently stumbled across some nuances which I thought would be worth sharing. Here's what I've learned:
Correct Variable for Accessing the Knowledge Base Answer:
The accurate variable for fetching the KB answer is turn.KnowledgeAgent.answer. The old formula {{event.kb.results.map((a) => a.dsFriendlyName + "\n" + a.content).join("\n\n")}}, as noted in this company video
, did not yield the desired outcome for me.
Demystifying the AI Task Card:
The 'AI Task Card' consists of four crucial fields for achieving the best results:
AI Task Input: Enter the variable VALUE in this format: {{sourceVariable}}.
Store Results in Variable Field: Just input the variable name as variableOutputName.
Task Example: Upon clicking this label, two additional fields will be unveiled.
Example Input: This is straightforward – insert a demo text which replicates what would be found in your {{sourceVariable}}.
variableOutputName: Populate this with the expected demo text so the AI Task can glean insights from it.
A word of caution: I initially found this layout quite puzzling. Especially as the 'AI Task Input' label conspicuously stood out, and there wasn’t a clear 'AI Task OUTPUT'. I ended up populating both the INPUT and OUTPUT within the first field, which surprisingly worked. However, I suspect this might not have been the developers' original intention.
Bellow is a screenshot with the above discussed fields
Happy coding! 🚀