wit-ai / pywit

Python library for Wit.ai
Other
1.46k stars 361 forks source link

Wit responded with status: 400 (Bad Request) #56

Closed azianmike closed 8 years ago

azianmike commented 8 years ago

I send over a query and I get back the stack trace

Traceback (most recent call last): File "bot.py", line 74, in client.interactive() File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 162, in interactive context = self.run_actions(session_id, message, context, max_steps) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 134, in run_actions return self.run_actions(session_id, message, context, max_steps, verbose) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 125, in __run_actions return self.run_actions(session_id, None, context, i - 1, verbose) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 85, in __run_actions json = self.converse(session_id, message, context, verbose) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 79, in converse resp = req(self.logger, self.access_token, 'POST', '/converse', params, json=context) File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wit/wit.py", line 31, in req ' (' + rsp.reason + ')') wit.wit.WitError: Wit responded with status: 400 (Bad Request)

Any help? Seems to be the wit code?

azianmike commented 8 years ago

non-issue

filipjad commented 7 years ago

How did you solve it? I am experiencing the same issue right now...

pnmartinez commented 7 years ago

Hi @azianmike , I'm experiencing the same problem too. The code I simply tested, directly from the README:

client = Wit(access_token)

resp = None
with open(AUDIO_FILE, 'rb') as f:
  resp = client.speech(f, None, {'Content-Type': 'audio/wav'})
print('Yay, got Wit.ai response: ' + str(resp))

Were there any insights on this that helped you solve it?

mohdnizamat commented 6 years ago

How is this resolved @azianmike ?

stopachka commented 6 years ago

Hey @mohdnizamat this would be caused:

if you could give me an example wav file that fails for you, I'd be happy to take a look