BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Microphone Turns off After a RetryPrompt Call

Open Amintasn opened this issue 6 years ago • 10 comments

Screenshots

Version

Webchat: V4.8 CDN: https://cdn.botframework.com/botframework-webchat/latest/webchat.js Botframework: V4

Describe the bug

When a prompt option has not been met e.g. Yes/No a RetryPrompt call is automatically raised by the bot framework. The RetryPrompt message is shown on the screen and spoken by the bot. However, the mic is automatically deactivated which forces the users to manually click on the mic icon to turn it on. Bot code snippet: await stepContext.Context.SendActivityAsync("Are you sure about it?:)", "Are you sure about it?", cancellationToken: cancellationToken); return await stepContext.PromptAsync(nameof(ChoicePrompt), new PromptOptions { Prompt = null, RetryPrompt = MessageFactory.Text("Try it again please","Try it again please"),
Choices = new[] { new Choice {Value = "Yes", Synonyms = new List {"sim"}}, new Choice {Value = "No", Synonyms = new List {"nao"}} }.ToList(), Style = ListStyle.Auto
});

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

The bot should show and speak a reply prompt message but keep the mic on for user voice reply.

Additional context

[Bug]

Amintasn avatar Mar 30 '20 16:03 Amintasn

Hi @Amintasn, thank you for filing this issue. I will take a look a close look at this today and get back to you.

corinagum avatar Mar 31 '20 17:03 corinagum

Thanks @corinagum. Really appreciated.

Amintasn avatar Mar 31 '20 19:03 Amintasn

Hi again, I was not able to get to this today but it is number 1 on my list for tomorrow. I apologize for the delay.

corinagum avatar Apr 01 '20 01:04 corinagum

No worries at all. Thanks for the update!

Amintasn avatar Apr 01 '20 12:04 Amintasn

Hi @Amintasn Sorry to say that I'm unable to reproduce this problem. Could you either provide a bot/link that shows this behavior, or provide more detailed reproduction steps?

Are there any console errors when you experience this?

I am using a speech enabled bot, using the multi-turn prompt v4 sample with reprompt text added in. Speech works as expected, and when I speak a non-valid choice (doesn't appear in the suggested actions), the bot reprompts, continues to show the suggested actions, and opens the microphone. I am able to then respond via speech as expected.

corinagum avatar Apr 01 '20 20:04 corinagum

Hi @corinagum , thanks for the fast reply. I can definitively do that but before we get into that I believe I know why the issue is not presenting to you. Your test code is probably not using the RetryPrompt option from the PromptOptions list. The default approach (without the Retry prompt option) works fine. However, we need to provide a custom message when an unexpected reply has been provided. Would you mind having a second look to that pls? The code snippet on the problem statement demonstrate the usage of the RetryPrompt call which goes like this: RetryPrompt = MessageFactory.Text("Try it again please","Try it again please")

Amintasn avatar Apr 01 '20 21:04 Amintasn

Hi @corinagum. Just wondering if you have any news about it. Please do not hesitate to reach me if you need further info about the issue. Thx!

Amintasn avatar Apr 03 '20 18:04 Amintasn

It looks like you can add the inputHint to the Activity.

Could you give this a try?

RetryPrompt = MessageFactory.Text("Try it again please","Try it again please", InputHints.ExpectingInput)

Schema

corinagum avatar Apr 03 '20 19:04 corinagum

Feel free to also take a look at this sample: core-bot

corinagum avatar Apr 03 '20 19:04 corinagum

Spot on Corina! Working perfectly now. Thanks a million for your help! Take care.

Amintasn avatar Apr 04 '20 15:04 Amintasn