My aim is to query a given database for bill amount of a customer. I will query it using the customer number which the user gives, use pandas to get the bill amount for that customer number, and then the chatbot should return the bill amount.
How do I accomplish this using slots? Exactly how should my domain.yml and stories.md files look like? And how should I modify my actions.py file to include the pandas querying bit?
If someone could answer these questions using a brief example, then great! Thank you.
Directly extract as in?
I need pandas to traverse the csv file in which some records are stored, to find the applicant number that the user mentioned in his message, and then get the bill amount. This pandas bit is done anyway.
Yes, that is what I’m doing right now. Directly dispatching. The problem is that this only works on the console, since I’m doing the pandas bit in the console.py file in rasa/core/channels.
I am currently working on a Rasa UI using Angular, and the problem is that I am not able to find the python file to add the pandas bit, like I did in console.py . Which is why I thought I would use slots.
Can you help me find the python file instead? Would be much easier…
I think console.py is not the right place to do such calculations. You can invoke a custom action and write your pandas logic there. Action class has a dispatcher that will enable you to dispatch the message to user.
For integration with Angular you can use the webhook REST API. i.e. POST /webhooks/rest/webhook
It will be invoked from the story you will write. The intent of user message will invoke the particular story and your custom action will be invoked as a consequence.
## pandas story
* ask_bill_amount
- action_calculate_bill_amount
Even to access slots you need the tracker object in the run method of action class. To set the slot, you can return the event SlotSet("slot_name", "slot_value") from the custom action.
I tried this. It asked to update endpoints.yml file and domain.yml file also, which I did. Now it keeps saying Requested URL not found or Couldn’t connect to the server.
This is what I uncommented out in endpoints.yml: