https://discord.gg/botpress logo
#šŸ’»developers
Title
# šŸ’»developers
q

quick-musician-29561

03/20/2024, 10:08 AM
@tall-state-14370 Now you have the API response object stored in a variable. So if filtering is not enough, you can feed that variable to an AI Generate Text and ask it to answer based on that. Then it's the same as having the data in the Botpress Knowledge Base. That works well even if the users are more creative with their questions (exactly what we want). Filtering works only when the question matches exactly the data, like 'email'. Filtering with JavaScript is useful when users can click buttons, and I prefer using JavaScript over AI when I need to get some data that needs to be 100% correct, like math. A good option is to mix those (like in this second version), first get all the data from the database or some other external API and filter it with JavaScript, then let AI generate a text answer based on that.