LUIS does not work when I integrate bot with webchat.js in any browser
See original GitHub issueHello, I created a chatbot in C# with my virtual assistant template and the web chat works fine with the iframe
<iframe src='https://webchat.botframework.com/embed/NAME_OF_BOT?s=YOUR_SECRET_HERE' style='min-width: 400px; width: 100%; min-height: 500px;'></iframe>
but LUIS doesn’t work when I integrate it with js in any browser
<div id="webchat" role="main"></div>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<script>
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({
secret: 'YOUR_DIRECT_LINE_SECRET'
}),
},
document.getElementById('webchat')
);
</script>
What can I do for this to work? I already tried to make it work by adding the secrets of webchat and directline.
This is the location of the error it send me:
public class DefaultAdapter : BotFrameworkHttpAdapter`
{
public DefaultAdapter(
BotSettings settings,
ICredentialProvider credentialProvider,
IBotTelemetryClient telemetryClient,
BotStateSet botStateSet)
: base(credentialProvider)
{
OnTurnError = async (turnContext, exception) =>
{
await turnContext.SendActivityAsync(new Activity(type: ActivityTypes.Trace, text: $"{exception.Message}"));
await turnContext.SendActivityAsync(new Activity(type: ActivityTypes.Trace, text: $"{exception.StackTrace}"));
await turnContext.SendActivityAsync(MainStrings.ERROR);
telemetryClient.TrackException(exception);
};`
Use(new TranscriptLoggerMiddleware(new AzureBlobTranscriptStore(settings.BlobStorage.ConnectionString, settings.BlobStorage.Container)));
Use(new TelemetryLoggerMiddleware(telemetryClient, logPersonalInformation: true));
Use(new ShowTypingMiddleware());
Use(new SetLocaleMiddleware(settings.DefaultLocale ?? "en-us"));
Use(new EventDebuggerMiddleware());
Use(new AutoSaveStateMiddleware(botStateSet));
}
}
which is in the startup.cs file:
services.AddSingleton<IBotFrameworkHttpAdapter, DefaultAdapter>();
the bot responds to me well when it enters the user data request flow (which does not need LUIS nor QnA) But it sends me the error when I send a message that needs to use LUIS and QnA
(Edited by @compulim for code formatting)
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (10 by maintainers)
Top Results From Across the Web
LUIS does not work when I integrate bot framework v4 with js ...
This is the current implementation for including BotFramework-WebChat in an html page, if not using an iframe. The page shouldn't block your ...
Read more >Add natural language understanding to your bot - Bot Service
Learn how to use LUIS for natural language understanding in your bot.
Read more >Embed a bot in a web page using Web Chat - Bot Framework
This post describes how to embed a bot in a web page using the Bot Framework Web Chat. The Web Chat control is...
Read more >Microsoft/BotBuilder - Gitter
<iframe src='https://webchat.botframework.com/embed/NAME_OF_BOT?s=YOUR_SECRET_HERE' ... but LUIS doesn't work when I integrate it with js in any browser.
Read more >Integrating Microsoft LUIS into the Bot Framework - Atmosera
To integrate our LUIS app into our bot we just have to update the app keys that our bot is using. In our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This also looks like a duplicate of this Stack Overflow question. @guadalupejaime can you try @stevkan’s recommendations and let us know if his answer resolves your issue?
I changed the code to this: