IBM / watson-nao-robot

Use a robot to answer queries on financial data by integrating with the IBM Watson Assistant service and IBM Watson Studio
https://developer.ibm.com/patterns/robotic-calculations-and-inference-agent
Apache License 2.0
38 stars 63 forks source link

Trouble with Step 11: Run The Notebook #44

Open CynthiaJeaneKaye opened 4 years ago

CynthiaJeaneKaye commented 4 years ago

Hello, I hope someone can help me with this issue. Someone had this issue previously, but there was no follow-up on it. I entered my Websocket URL into the notebook, ran each cell in order from top to bottom, but I received this error:

DEBUG:websocket:----------------------- send: b'\x81\x97\xe7<4\xdd\x9c\x1eW\xb0\x83\x1e\x0e\xff\xa3ol\xfd\xafYU\xaf\x93~Q\xbc\x93\x1eI' DEBUG:websocket:send: b'\x81\x97\xe7<4\xdd\x9c\x1eW\xb0\x83\x1e\x0e\xff\xa3ol\xfd\xafYU\xaf\x93~Q\xbc\x93\x1eI' error from callback <function on_message at 0x7f4ac4764620>: 'botresponse' ERROR:websocket:error from callback <function on_message at 0x7f4ac4764620>: 'botresponse' File "/home/spark/shared/user-libs/python3.6/websocket/_app.py", line 346, in _callback callback(self, *args) File "", line 7, in on_message for item in msg["botresponse"]["messageout"]["context"]["entities_array"]: Unhandled exception in thread started by <function on_open..run at 0x7f4a941dbc80>

I suspect I will run into several more issues after this one is solved, so thank you in advance for the help!

AlexandrLucas commented 4 years ago

It's been a while since I last interacted with this, but my advice would be to print out the full response from the websocket, if possible. This way you can check if the error comes from structure of the msg being different for some reason -- and it can be fixed by changing msg["botresponse"]["messageout"]["context"]["entities_array"] accordingly.

CynthiaJeaneKaye commented 4 years ago

How would I print the response? I am not great at Python yet.

RK-Sharath commented 4 years ago

Please start the Websocket listener first by running the last cell in the notebook and then start interacting with the UI.

CynthiaJeaneKaye commented 4 years ago

@RK-Sharath I do not know which UI you are referring to. When all the cells are run, this happens: Error @Quiescitus I have attempted to print the response using a few different methods, but none gave me results I needed. Please let me know if there is a specific way I am supposed to do it. If I cannot print the response, is it possible this information is on the Node-Red site somewhere?