wit icon indicating copy to clipboard operation
wit copied to clipboard

Why does the API sometimes return type:stop instead of the action?

Open mikob opened this issue 10 years ago • 5 comments

Sometimes I get:

{'entities': {'intent': [{'value': 'class fetch', 'confidence': 0.9942279478428431}]}, 'type': 'stop', 'confidence': 0.17692120631776423}

Even though wit seems pretty confident that I'm asking for a class fetch (I am). What is the type: stop representing? I don't see it referenced in the docs. It makes it difficult to interface the action when I get this unpredictable result.

Thanks in advance!

mikob avatar Jul 04 '16 19:07 mikob

Hi,

this is something like the system thinks that a story is reached the end...

You can see this in the Logs when e.g. the bot responds with a final answer at the end of a story. screen shot 2016-07-05 at 12 45 25

misysdclabs avatar Jul 05 '16 10:07 misysdclabs

All 9 of my stories have actions or jumps at the end. Wit got the intent right, "class fetch". Here is a screenshot of the only story with that intent where you can see it has the getClasses action associated with the story. Is this a bug? screenshot from 2016-07-05 22-35-41

mikob avatar Jul 05 '16 13:07 mikob

stop means that your bot has finished doing actions and sends, and must wait for the next user input (it could have been called prompt). You can learn more here: https://wit.ai/docs/http/20160330#converse-link

If I understand well, you get stop before you get getClasses? In interactive Node.js mode or in the Chat window in console? Can you please paste what you see?

ar7hur avatar Jul 05 '16 13:07 ar7hur

I'm using the python api like this: resp = wit_client.converse(self.id, msg, {})

Anyway, I found what I was doing wrong, your link pointed me in the right direction, thank you. I wasn't calling converse after receiving an action. Apparently I need to call converse after receiving an action even though I'm not sending up any message or new context. I guess wit.ai expects me to do that in case I have new context to send up as a result of the action.

mikob avatar Jul 05 '16 15:07 mikob

When my bot sends multiple replies at once, it doesn't send "stop" afterwards, thus causing WitError: Max steps reached. Any idea why this happens? How is it determined in Wit.ai when "stop" should be sent? Here is the link to my app: https://wit.ai/jiajiazhang/Gooroo/logs/-1 The issue occurs after the "answerQuestions" action is executed. "Stop" is supposed to follow {askfdbk}. I'm using the interactive mode in Python. The chat window in console works fine though.

Thanks a lot!

jiajia-z avatar Apr 12 '17 15:04 jiajia-z