in the actions file i have the following instructions :
#build the button paload in jsonaa andsend it via the dispatcher to the channel
dispatcher.utter_message(json_message=jsonaa)
# await asyncio.sleep(5)
message = tracker.latest_message['text']
print(message)
the button is used to retrieve the user’s location. Once he clicks on it, the location is sent to the bot.
Now the problem is that I can retrieve the location sent to the bot beacause the bot continues on the other instructions before the user has pressed the button. So when i print the message i have the last text entered by the user (the on that triggered the action). The actions after the uter_message are executed before the bot receives the location.
like you see
the user : hi
the bot : greet
the user : ask for location
the bot: ask to share and send a button (the button is not visible here)
So like i said Basically the problem is that the execution of the form ends before the location is sent to the bot. if you see the image the other log messages appear. So I would like to wait for the response (the location) before continuing the execution of the form
i used an action to ask for the slot and i am able to wait for the user input but the form validation and the action that i have defined in the storie are not runned.
Here is the rule:
- rule: Activate form
steps:
- intent: localisation
- action: loc_form
- active_loop: loc_form
- rule: submit open loc form
condition:
- active_loop: loc_form
steps:
- action: loc_form
- active_loop: null
- action: action_loc_searching
Hello thanks for your reply
The button is related to the telegram channel so we don’t have to send our location manually .
I saw in the documentation in the custom responses for telegram connector that we have a location button but I don’t know how to use it.
Here Telegram
the problem is that it will be in a form and i need to keep the value of the location in order to do some calculs
so far i have a slot called location like defined here
a form, a slot validation action. i thinkk that oonce the button is clicked it trigger another intent maybe beacause of the format
once the button is sent to the user, now he can click on it and its send the location of the user. the bot is waiting for the user’s responses but when he get it, he predict another intent instead of doing the validation. the text that is sent to the user for the location is in this format :
Despite the fact that I have defined the entitie location and I believe that I have correctly defined the slot in the domain
entities:
- location
slots:
location:
type: any
mappings:
- type: from_entity
entity: location
intent: [localisation, inform]
not_intent: [chitchat,greet,goodbye,affirm,deny,mood_great,mood_unhappy,bot_challenge]
conditions:
- active_loop: loc_form
requested_slot: location
- intent: inform
examples: |
- here is my loc [{"lng":-10.123804, "lat":18.45626}](location)
- [{"lng":-11.658804, "lat":14.45226}](location)
the configuration file is also well defined
looking at the tracker, I can’t see anything in the entities so they are not extracted and its weird for me