e8180kimo
(e8180kimo)
January 7, 2019, 10:42am
21
This is generated by the code I use from you.
def submit(self, dispatcher, tracker, domain):
agree_info = AgreeInfo()
booking = agree_info.save(tracker.latest_message.get("text"))
#user_id = tracker.sender_id
user_id = (tracker.current_state())["sender_id"]
print ("user id: " + user_id)
print (tracker.latest_message.get("text"))
Akshit
(Akshit)
January 7, 2019, 10:43am
22
commented line will also work!
e8180kimo
(e8180kimo)
January 7, 2019, 10:50am
23
But now the problem is to replace the default
to a certain user_id
right? As my code get the user_id by rasa, still doesnt work
Akshit
(Akshit)
January 7, 2019, 10:53am
24
Okay try this ! Run the bot by enabling api and then do local host call with a user_id like 123
http://localhost:5005/conversations/123/respond?q=hi
Now do tracker call in postman
http://localhost:5005/conversations/123/tracker
Check out the answer if coming, then try your tracker saving action
e8180kimo
(e8180kimo)
January 7, 2019, 10:56am
25
I think it was because I didnt enable api using --enable_api
Now, I use the user_id generated by rasa and it works on postman
e8180kimo
(e8180kimo)
January 7, 2019, 10:59am
26
But now, I put the requests code back and it doesn’t work again…
I used the user_id and tried on postman, but it just stuck and no response.
The idea is to use requests to get the log and save to a txt file.
e8180kimo
(e8180kimo)
January 7, 2019, 11:05am
27
@Akshit or do you know is there any other method that I can pull out the log and save it to a txt file for each user without using requests?
Also I found out the postman responded until I stopped my action server and it showed the log.
Akshit
(Akshit)
January 7, 2019, 11:31am
28
Sorry I haven’t worked on something like that! I’ll send a link if I find something
vaba01
(vans)
December 9, 2022, 3:55pm
29
Hi, @Akshit did you figure this out? I am also trying to get the recipient_id in custom actions, but the answers here only talk about sender_id, which is not the same
vaba01
(vans)
December 9, 2022, 4:43pm
30
I know how to get sender_id in actions but not sure how to change it via the API call. I get the default sender_id for now.
vaba01
(vans)
December 9, 2022, 4:45pm
31
Also for info, I use parse msg API Rasa & Rasa Pro Documentation