-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Directline speech - web socket ends with 200 response #3407
Comments
@collegewap it seems like there might be something wrong with how you configured directline speech for your bot, as for a first test, I just simply did the following successfully: Test with the Already-Made Mockbot Sample(mockbot is the bot that the webchat sample talks to, whose code is separate from the
No idea how you got the error that you did, as you didn't provide repro steps as to what you did exactly to set up your bot...however I'll provide repro steps below on how to configure speech in your bot successfully. Setting up a Bot Configured to Direct Line SpeechThis is just setting up an echo bot with DLS to enable speaking to your bot. It can be succinctly summarized as
Get a fresh clone of Echo Bot and Test Locally
Deploy your bot to Azure
Provision Speech cognitive service
Enable DirectLine Speech Channel
Register Direct Line Speech Channel Run sample 03.speech/a.direct-line-speech and talk to the DLS-enabled bot.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Web Chat: Using Direct Line Speech</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Direct Line Speech adapter set is only available in full bundle -->
<script crossorigin="anonymous" src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
}
#webchat {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
(async function() {
const adapters = await window.WebChat.createDirectLineSpeechAdapters({
fetchCredentials: {
region: 'xxxxx',
subscriptionKey: '89exxxxxxxxxxxxxxxxxxxxxxxxxxxx2'
}
});
console.log(adapters);
// Pass the set of adapters to Web Chat.
window.WebChat.renderWebChat(
{
...adapters
},
document.getElementById('webchat')
);
document.querySelector('#webchat > *').focus();
})().catch(err => console.error(err));
</script>
</body>
</html>
The bot speaks back! If you follow the steps above, which are similar to this tutorial on enabling speech in your bot (they use C#), then you should be able to run sample 3a just fine |
Hmm, looking around there does seem to be some issue on the other layers regarding DLS. What kind of browser and OS are you using @collegewap ? |
The bot is working fine (Tried example 1a). If I try the speech services also, it works fine. I made sure that all the steps to enable directline speech are done correctly. Still facing the issue. I am using Windows 10+ Chrome. Tried in Firefox as well. Same error. I tried https://compulim.github.io/webchat-loader/ with the mock bot and getting the same error. My region is eastus2. |
Hmm...ok, @collegewap, I think what we need now here is painfully explicit step-by-step of what you're doing, just so that we can get a repro of your issue. Please provide exact repro steps of at least one thing you're doing to get your error, so that we could hopefully get it too and dig down to a resolution Because when I try going to, for example:
I never get the " There are probably discrepancies between what you're doing and what we're doing, and it's not clear what they are without more detail. Curious to know what endpoint you're trying to call from WebChat to your bot, because looking at just this code snippet from sample 3a const res = await fetch('https://webchat-mockbot-streaming.azurewebsites.net/speechservices/token', {
method: 'POST'
}); To get a token for mockbot, it calls Anyways, so again, please provide as much detail as possible, so we can get a repro on the error |
Here are the steps I am doing:
My setup: And about 3a, we have an endpoint that generates the token. Also, I have tried the example given by you in #3407 (comment), by passing the speech key and getting the same error. |
@Zerryth We followed the same steps in another instance and it worked fine. Not sure what is the issue with this specific bot instance. Thanks for your help. |
Screenshots
Version
4.9.1
Describe the bug
I have enabled directline speech in our bot by using the following example and I am getting the error "Error during WebSocket handshake: Unexpected response code: 200". I tried both the options of passing token and passing the subscription key and facing the same issue.
https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/03.speech/a.direct-line-speech
Note: Cognitive speech approach works fine.
What could be the possible cause for this?
The text was updated successfully, but these errors were encountered: