How to integrate rasa bot with android

It is indeed a very good app, and an inspiration for new learners. Keep up the good work :ok_hand: :+1: :grinning_face_with_smiling_eyes:

1 more update, I used tracker.current_state()['sender_id'] found on this thread. I took very less time than I thought. Thanks to the Rasa community, you guys are Awesome!!!

class ActionHelloWorld(Action):

    def name(self) -> Text:

        return "action_receive_email_id"

    def run(self, dispatcher: CollectingDispatcher,

        tracker: Tracker,

        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        text = tracker.current_state()['sender_id']

        return [SlotSet("email_id", text)]
1 Like

instead just do tracker.sender_id it will give you the senderid

1 Like

Ok will try that as well. Thank you :+1: :grinning_face_with_smiling_eyes: I did not find these statements in the documentation, is there a special section for rasa for android?

nope, isn’t there right now

Hope they build a dedicated documentation for Android, iOS and web platform soon, or the community comes together and creates a documentation come tutorial :grinning_face_with_smiling_eyes:

1 Like

great idea!

Hey @Horizon733 , I need help with with sending multiple responses from the bot Action. Scenario: step 1: user sends a message to the bot for an operation to be performed on his account. step 2: bot recognizes it and and responds with utter_assurance step 3: an action is called related to the account operation. (In the action there are multiple responses such as list of orders, I want these orders to be sent as individual responses along with buttons.)

I am using the code from your covid app tutorial. I tried your tutorial on Youtube part 5 which shows how to display images and multiple responses from the bot. In that tutorial the sender is declared as an Integer, but I am passing user’s email ID as sender_id which is a string. So I am stuck at this place. How do I pass user’s email ID as sender_id and display multiple messages from bot’s utterances as well as from the actions?

Thank you

yeah, you will have to customize your channel a bit. I am building a tutorial on new ways to integrate with Android, since, Android has grown up quite a good

Oh That sounds good. By when will the tutorial be released ?

You can use this to make app
https://appinventor.mit.edu/

And then it’s service called “web”, just make bot on website, point web to that address and it will show in your phone.

Hi, here’s the tutorial link

2 Likes

Hi @InnoOmnia, Thank you for sharing the link to App Inventor, I am already aware of it. Here I am stuck with the use of variables which I am not able to find in the documentation of RASA.

Thank you @Horizon733 for this wonderful tutorial, it is easier than the previous tutorials.

I am now trying to export the conversation in a simple format

user: Hi
bot: Hi
user: i am facing issue
bot: sure I will help you out

In this format, so that when we do a human handoff to zendesk agent, the agent has history of the chat that the user already had with the bot. I tried this so far

class ActionSaveConversation(Action):

    def name(self) -> Text:
        return "action_save_conversation"

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

        print(tracker.events)

but I am sure there will be a way more simpler method than this.

you want to save the convos na, use tracker store, docs have that, or
Are you trying to add just bot and user messages seperately in a db? Then I suggest you to create a simple python server running in middle of Rasa and that channel you are using. That will save the messages that user sends or bot sends. I think this will be easy and better way to achieve this instead of using tracker events

1 Like

Thank you @Horizon733 for the docs, I will go through it. My 1st usage is to make human handoff action which will create a ticket on zendesk when the user asks to interact with a human. Then our agents will take care of the ticket by going through the conversation the user had with the bot.

My 2nd usage will be storing all the chats in the db for analysis and improvements. I have enabled tracker for mongodb, but not yet focusing completely on it. It is simply dumping the whole json into the view.

I will checkout if I am able to find any tutorial for implementing python server between rasa and the channel. Thank you so much for the suggestion.

Sure, happy to help. :blush:

1 Like

Hey @Horizon733 , I went through the documentation, but it seems it has ways to sync the whole chat to db with all the parameters. i.e each and every event the bot had. I am not able to find any documentation where it shows how can we use the conversation (Only the utterances from user and the bot.). Have you come across such implementation?

I am sorry, My bad, This happens When I see only the first half of the tutorial :sweat_smile:

class ActionSaveConversation(Action):

    def name(self) -> Text:
        return "action_save_conversation"

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

        conversation = tracker.events

        for i in conversation:
            if i['event']=='user':
                print('user: {}'.format(i['text']))
                if len(i['parse_data']['entities'])>0:
                    print('extra data:',i['parse_data']['entities'][0]['entity'],'=',i['parse_data']['entities'][0]['value'])
            elif i['event']=='bot':
                print('Bot: {}'.format(i['text']))

This is how I am able to get only the chat data from the whole conversation. I’ll be storing it into a Json and pass it as a message to the Zendesk ticket creation API.

1 Like

Happens, make sure to complete the tutorial whenever you see

1 Like