botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Can't use prompts in proactive dialog

Open randa1 opened this issue 10 years ago • 16 comments

My use case is this:

  1. User A initiates conversation with the bot
  2. According to the conversation result, the bot triggers a dialog with user B via bot.beginDialog (proactive).
  3. The bot presents user B with a confirmation prompt.
  4. User B answers the prompt ("yes").
  5. Bot returns "I didn't understand" error.

What's happening is that the answer to the prompt is received in a different dialog than the one triggered in step 2 (the root dialog from the previous conversation). Which is confusing, since the documentation for bot.beginDialogsays:

Proactively starts a new dialog with the user. Any current conversation between the bot and user will be replaced with a new dialog stack.

But it seems that the dialog stack isn't really replaced, as the incoming message isn't directed to the input dialog.

I'm using UniversalBot with ChatConnector, Node.js SDK version 3.1.1. I've reproduced it on several channels (Slack, Skype, Facebook).

Am I missing something here?

randa1 avatar Jul 21 '16 13:07 randa1

I am experiencing a similar issue with all of my prompts, which are started depending on a LUIS dialog response. One of the features for a bot I am working on is the ability to retrieve the forecast for a ZIP code. If you request, say, "weather 53204", the number entity is recognized and the forecast pulls as usual. Otherwise, it prompts you to enter your ZIP code, then retrieves the forecast.

In the past, both cases worked just fine. With the recent upgrade to BotFramework 3, however, only the case where an entity is recognized works. If I enter in a ZIP code at the prompt, the ZIP code is forwarded back to LUIS, which gives a completely irrelevant response. Here is the log:

ChatConnector: message received. weather session.beginDialog(/) / - session.sendBatch() sending 0 messages / - IntentDialog.matches(Weather) / - waterfall() step 0 of 2 / - session.beginDialog(BotBuilder:Prompts) .Prompts.number - session.send() .Prompts.number - session.sendBatch() sending 1 messages Just call me the WeatherBot. What’s your ZIP code? ChatConnector: message received. 53221 session.beginDialog(/) / - session.sendBatch() sending 0 messages / - IntentDialog.onDefault() / - waterfall() step 0 of 1 / - session.send() / - session.sendBatch() sending 1 messages Logging this question into the training files. I can answer this once I’ve been trained a bit more!

anthonyjesmok avatar Jul 21 '16 17:07 anthonyjesmok

I as not able to get the prompts working on a proactive bot even in the previous version.

officialdharam avatar Jul 22 '16 10:07 officialdharam

@randa1 Coming across the same issue. Did you ever find a solution?

thingista avatar Aug 05 '16 12:08 thingista

Unfortunately I didn't...

I handled it in code by defining a different intent for the response of the prompt.

I haven't tried this in version 3 of the framework, I hope it works there.

officialdharam avatar Aug 05 '16 13:08 officialdharam

@officialdharam Thanks a lot. It does not work in v3 either unfortunately...

thingista avatar Aug 05 '16 13:08 thingista

So when you try to contact user B from user A's conversation, where are you getting the address for user B from? You can only start a new conversation with user B using the address object saved from a previous conversation with user B. Is that what you're doing?

Stevenic avatar Aug 06 '16 06:08 Stevenic

You can't reliably create a new address object from scratch

Stevenic avatar Aug 06 '16 06:08 Stevenic

@Stevenic (following up on the conversation on Gitter). Even when there's only one user involved it does not seem to work. E.g.:

intents.matches(/__test/, function(session){
  bot.beginDialog(session.message.address, '/test');
});

bot.dialog("/test", [
  function(session, args, next){
    builder.Prompts.choice(session, "Choose:", ["foo", "moo"]);
  },
  function(session, results){
    session.send("You chose: " + results.response.entity);
    session.endDialog();
  }
]);

The second step of the /test waterfall is not called.

thingista avatar Aug 06 '16 07:08 thingista

I just verified that proactive dialogs aren't working. There was a bug in the Node SDK but there's also a bug in at least the Facebook channel that I need Tom to look into. He's out of town until Wednesday so unfortunately may take us a couple of days to get this ironed out.

Stevenic avatar Aug 06 '16 17:08 Stevenic

@Stevenic Understood. Thanks a lot. Just wondering: have you committed the Node SDK change already (I am only using Skype at the moment and would be keen to give it a go), or will you wait for the other changes?

thingista avatar Aug 06 '16 19:08 thingista

I'll try it with skype. we're not sure if it's limited to Facebook so I'll give it a go on skype later today. I'm not convinced I have my side fully fixed yet.

Stevenic avatar Aug 06 '16 19:08 Stevenic

I think I have it fixed... Just pushed v3.2.3 give that a try

Stevenic avatar Aug 06 '16 20:08 Stevenic

@Stevenic Fantastic. It's working for me on both Skype and Slack. Thank you so much for doing this. I have to say I did try to find a fix... to no success :-).

thingista avatar Aug 06 '16 21:08 thingista

I remember raising this as a concern two months back... Nice to see that it works now.

officialdharam avatar Aug 07 '16 05:08 officialdharam

We've had a lot of bugs on our plate. Sorry it took so long to get to this one but glad it's working now :)

Stevenic avatar Aug 07 '16 14:08 Stevenic

I'm still having this issue with V3.2.3 in Facebook. The second step of the waterfall is not called. Instead the root step ('/') is called.

raphael-abreu avatar Aug 23 '16 18:08 raphael-abreu