Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: service [/wit/interpret] responded with an error: error processing request: 'outcomes' #9

Open
rcpilotp51 opened this issue Dec 19, 2017 · 18 comments

Comments

@rcpilotp51
Copy link

rcpilotp51 commented Dec 19, 2017

Hello, did wit.ai change the json that comes back? I installed the package and i could get it to work with your api_key, but when i change it to mine with my own intent I get the following error:

ERROR: service [/wit/interpret] responded with an error: error processing request: 'outcomes'

I'm not sure how to fix this. any suggestions?

this is a sample outcomes in the log tab:

[ { "entities": { "intent": [ { "confidence": 0.96992436209788 "value": { "value": "teleop" } "entity": "intent" } ] } "confidence": null "_text": "turn right" "intent": "default_intent" "intent_id": "default_intent_id" } ]

@LoyVanBeek
Copy link
Owner

Hmm, that is interesting. I requested my API key ages ago.

Also, according to the docs (Dated to march 3, 2017)), their API is versioned by date.
Given the date of that page, I assume the format hasn't changed since March.

But looking at the docs, 'outcomes' is only used in https://wit.ai/docs/http/20170307#get--messages-:msg-id-(deprecated)-link.

For the message-API,
Could you please try to change https://github.com/LoyVanBeek/wit_ros/blob/master/src/wit_ros/wit_node.py#L28 into

entities = response["entities"]

@rcpilotp51
Copy link
Author

Thanks for your response. I tried that and got:

[ERROR] [1513730968.147115]: Error processing request: 'outcomes'
['Traceback (most recent call last):\n', ' File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/kbrown/Development/ros/ws/src/wit_ros/src/wit_ros/wit_node.py", line 62, in interpret\n return self.parse_response(wit_response, InterpretResponse)\n', ' File "/home/kbrown/Development/ros/ws/src/wit_ros/src/wit_ros/wit_node.py", line 43, in parse_response\n outcome = Outcome( confidence = float(response["outcomes"][0]["confidence"]),\n', "KeyError: 'outcomes'\n"]

@rcpilotp51
Copy link
Author

i changed the following and it seems to be working:
entities = response["entities"]
outcome = Outcome( confidence = float(entities["intent"][0]["confidence"]),
entities = ros_entities,
intent = str(entities["intent"][0]["value"]))

@LoyVanBeek
Copy link
Owner

Could you make a PR with that? I have some tests on travis which I'd like to run against that patch.

@rcpilotp51
Copy link
Author

update on this: doesnt seem to be working with multiple entities and fails to pull the intent -

[ERROR] [1521648149.714662]: Error processing request: 'intent'
['Traceback (most recent call last):\n', ' File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 625, in _handle_request\n response = convert_return_to_response(self.handler(request), self.response_class)\n', ' File "/home/kbrown/Development/ros/ws/src/wit_ros/src/wit_ros/wit_node.py", line 70, in interpret\n return self.parse_response(wit_response, InterpretResponse)\n', ' File "/home/kbrown/Development/ros/ws/src/wit_ros/src/wit_ros/wit_node.py", line 50, in parse_response\n outcome = Outcome( confidence = float(entities["intent"]["confidence"]),\n', "KeyError: 'intent'\n"]

i modified my app to have one intent teleop_intent with the value of "navigation" - with entities "direction" and "heading"

direction = forward, back, left right ... north, south, etc
heading = 120, 50, ...

example: "turn left to a heading of 120" or "face north" or "turn left and face north"

any help would be appreciated

@LoyVanBeek
Copy link
Owner

Is there a way I can test with your Wit apps somehow? Things seem to work fine with the few Wit apps that I have.
My box runs v 4.3.0 of wit:

$ pip2 freeze | grep -i wit
wit==4.3.0

@rcpilotp51
Copy link
Author

rcpilotp51 commented Mar 23, 2018

pip2 freeze | grep -i wit
wit==4.3.0

I have the same version.
Let me know your username at wit.ai im assuming "LoyVanBeek" (nope)

@rcpilotp51
Copy link
Author

@LoyVanBeek what is your wit.ai username I'll share my wit account with you. Thanks

@LoyVanBeek
Copy link
Owner

Hey, I though I already responded, sorry. My username on wit.ai is 'yol'

@rcpilotp51
Copy link
Author

rcpilotp51 commented Mar 26, 2018 via email

@rcpilotp51
Copy link
Author

@LoyVanBeek have you had a chance to look into the issue? curious what you found.

@LoyVanBeek
Copy link
Owner

I finally found some time to look into this, I've barely been at home these last 2 weeks.

Apparently my own intents are drastically out of date and deprecated even, so I added a warning to warn for deprecation.

Your stuff seems to work now on branch fix/#9. Please check if it works correctly now.

@rcpilotp51
Copy link
Author

rcpilotp51 commented Apr 9, 2018 via email

@LoyVanBeek
Copy link
Owner

It's on the fix/#9 branch. I can see those changes on github, so 100% sure I pushed those changes.

@rcpilotp51
Copy link
Author

@LoyVanBeek great work i can confirm that fix/#9 is working - my intents are just CRAP ;)

THANK YOU very much for spending time on this.

@rcpilotp51
Copy link
Author

side note: are you using this with voice recognition? if so what does that look like?

@LoyVanBeek
Copy link
Owner

I don't use it at all lately, not with voice either.

LoyVanBeek added a commit that referenced this issue Apr 10, 2018
Fix/#9: Update to newer wit.ai API
@rcpilotp51
Copy link
Author

Thanks again. This is going to be the basis of the "intelligent" side of my robot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants