Closed spaelling closed 6 years ago
Hi @spaelling,
Do you still experience the issue?
Same for me!
in wit.ai did you spell 'get_forecast' exactly like the bottom? actions = { 'send': send, 'getForecast': get_forecast, }
def throw_if_action_missing(self, action_name):
if action_name not in self.actions:
raise WitError('unknown action: ' + action_name)
Same here. What is a "NoneType" action?
Same here:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pierre/Dropbox/Projects/chobot/venv/lib/python3.5/site-packages/wit/wit.py", line 210, in interactive
context = self.run_actions(session_id, message, context, max_steps)
File "/home/pierre/Dropbox/Projects/chobot/venv/lib/python3.5/site-packages/wit/wit.py", line 176, in run_actions
context, max_steps, verbose)
File "/home/pierre/Dropbox/Projects/chobot/venv/lib/python3.5/site-packages/wit/wit.py", line 149, in __run_actions
self.throw_if_action_missing(action)
File "/home/pierre/Dropbox/Projects/chobot/venv/lib/python3.5/site-packages/wit/wit.py", line 214, in throw_if_action_missing
raise WitError('unknown action: ' + action_name)
TypeError: Can't convert 'NoneType' object to str implicitly
The problem comes from the fact that the payload return from the Converse API contains action: None
.
In order to catch the error, this change could be made:
raise WitError('unknown action: ' + action_name)
raise WitError('unknown action: ' + str(action_name))
While that gets rid of the TypeError, I still have trouble understanding why Wit returns a None action here. Is it mandatory to have user input that relates to an action when using the Converse API? If no action is matched, isn't possible to just return text, intent etc. and no action payload at all?
I have to say that while I like the fact that your docs are recipe-based, I find the overall Documentation of Wit not to be very clear. If I manage to get a better grasp of it, I'd be happy to contribute to the docs of at least this repo.
Closing actions-related issues. Please check out the new examples with the /message implementation :)
I am sometimes getting the below error. Seems to be when wit.ai is unable to determine the intent. Could this be responded to in a more elegant way?
Or am I doing something completely wrong?