wit-ai / pywit

Python library for Wit.ai
Other
1.45k stars 359 forks source link

Empty context when using messenger.py #83

Closed ghost closed 7 years ago

ghost commented 7 years ago

I have a story branch where the user gives a location, which is stored as context['location'] and used in a function later as foo(context={location}, entities={intent, sector}). My client side function takes these two arguments as foo(location, sector).

When using the local interactive client, I can extract context['location'] no problem and everything works as it should. However when using the messenger code (largely unaltered from messenger.py), there are no context keys at all, context is an empty dict. Is this due to run_actions() needing a context param? I tried using message['context'] as the param but it didn't exist, so I'm a bit confused as to what I need to do.

ghost commented 7 years ago

Fixed it by creating a global variable from context['location'].