Hello chatbot enthusiasts,
I am seeking support for a project I am working on.
TL;DR: How can I call javascript API functions from my Rasa actions (with parameters)?
Long Version: In this project, I want to use a Rasa chatbot to interact with Microsoft PowerBI reports (visualizations of company data) embedded in a web app. In our use case the user tells the bot what information he wants to see, and the embedded report updates itself accordingly.
Now, PowerBI already offers a handy javascript API, which allows you to interact with reports embedded in the html of your website. Just as an example, usage of that API might look like this:
function setFilter(region)
const filter = {
target: {
table: "Geo",
column: "Region"
},
operator: "In",
values: [region]
};
report.setFilters([filter])
This would update one of the filters on the embedded report.
Now, how would I call this js function from my chatbot actions? I also want to pass an extracted entity value as parameter region
to the js function.
Is there a way to execute js functions in another file? Or is there a way to implement the rasa actions server in javascript instead?
In the end, both the embedded report and the chatbot should be accessible on the same web application. But right now, I just want to use rasa shell to have my action update one filter on an embedded report as a first step.
Thanks in advance, any help is appreciated.
-Tobi