How to use rasa core bot server in a web app?


Earlier i.e when rasa core was at 0.10 version. We had /parse endpoint for accessing rasa bot http server. From newer versions /parse is being removed. I have a bot model on 0.11 but now i am not able to integrate it with my web client which is on node.js.

Has any one tried or designed any http api architecture for this then please help!

FYI - Here i want the bot i.e rasa core model to handle all the conversation flow logic by custom actions which i have implemented and all the API calling at my client end i.e at my node app end.

you can check this article , written on 0.11 however

hey! thanks for the reply and the blog is of great help but i have an issue i.e here i want the 3rd party API handling at my client side i want my custom actions to handle conversation flow only .

I am not sure what you mean ?

their are API’s which my bot will call for some actual work to do for instance calling an API to verify employee code for verifying or authenticating the user.

Till now my bot is only doing abstract work, like in your blog you have suggested to handle API calling in custom actions but here i do not want my custom actions to handle API calls. Here i want my client (node app mentioned above ) to handle all the API calling like employee verification, mobile number check and etc.

I hope this helps you to understand!

That pattern has changed now. In the previous pattern, Rasa was more of consult mode but in the new one, it is more how it sits in between.

You can use a the node app to act as a custom action server as well and return the values back to rasa core

FE —> Node App(Middleware) --> Rasa(ML) --> Node App(executing custom action)

Return of the execution of the Node App could simply pass through Rasa

the advantage is having Rasa manage the templates

how can i do that? the node execution of custom action?

have you tried creating action server on any other language?

Right now as far as i am getting we have created the action server on python and have passed its url as an endpoint to the core server. Now i have to write the code for action server in other language like node or etc and have to pass its host url to the core endpoint.

In the action server we have actions like this -

class ActionCheckRestaurants(Action):

def name(self): # type: () -> Text return “action_check_restaurants”

def run(self, dispatcher, tracker, domain): # type: (CollectingDispatcher, Tracker, Dict[Text, Any]) -> List[Dict[Text, Any]]

  cuisine = tracker.get_slot('cuisine')
  q = "select * from restaurants where cuisine='{0}' limit 1".format(cuisine)
  result = db.query(q)

  return [SlotSet("matches", result if result is not None else [])]

Here we can set slots and use tracker and set action names and etc in python but how can we mention these in other language ?

I hope you are getting what i am trying to ask!?