Hi there, long time lurker, first time poster.
I’m working with your framework and I implemented a system that works with external frameworks. This receives some data about the user in a Flask endpoint. To predict the intend I have an agent that loads a model I previously trained. So far, so good.
In your documentation you reported as follows:
class FetchProfileAction(Action):
def name(self):
return "fetch_profile"
def run(self, dispatcher, tracker, domain):
url = "http://myprofileurl.com"
data = requests.get(url).json
return [SlotSet("account_type", data["account_type"])]
This custom action uses an URL to fetch the user’s profile, however having a static URL to get user information is almost never the case. In a “normal” case the URL is provided from the service in the HTTP request body. What I want to do is, to call an action and provide some piece of external information, not provided by the (Rasa) form. For example:
url = f"http://myprofileurl.com/{username}/profile"
How can I pass this piece of information from the Flask endpoint to the custom action (in a clean way)?