Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

LUIS not recognizing dialogs stored in subfolders #62

Closed
teamplumaa opened this issue Nov 14, 2018 · 5 comments
Closed

LUIS not recognizing dialogs stored in subfolders #62

teamplumaa opened this issue Nov 14, 2018 · 5 comments

Comments

@teamplumaa
Copy link

Microsoft BotbuilderSDK: 3.15.0
Language: NodeJs

I am trying to initialize my dialogs with LUIS but it's not working.

I have each dialog in different subfolders. I am using bot.library and require to call the subfolders in app.js. The dialogs work when I use session.beginDialog to trigger them as in the example below.

var bot = new builder.UniversalBot(connector, function (session) {
session.beginDialog('hello:Hello')
}).set('storage', cosmosStorage);

But the conversations are not initiated when Luis is included. Each conversation has the correct LUIS calls/integrations.

Here is the full source code:

require('dotenv').config();
const restify = require('restify');

const builder = require('botbuilder');

var fs = require('fs');

var clients = require('restify-clients');

var azure = require('botbuilder-azure');

var listenPort = process.env.port || process.env.PORT || 3978;

var server = restify.createServer()

server.listen(listenPort, '::', () => {
  console.log(`ssssTestt`)
});


var connector = new builder.ChatConnector({
    appId: process.env.MICROSOFT_APP_ID,
    appPassword: process.env.MICROSOFT_APP_PASSWORD
});


var bot = new builder.UniversalBot(connector, function (session) {
    session.endDialog(`I'm sorry, I did not understand '${session.message.text}'.\nType 'help' to know more about me :)`)
}).set('storage', cosmosStorage);


var luisRL = new builder.LuisRecognizer(process.env.LUIS_MODEL_URL).onEnabled(function (context, callback) {
  var enabled = context.dialogStack().length === 0
  callback(null, enabled)
});


var intents = new builder.IntentDialog({ recognizers: [luisRL] });
bot.recognizer(intents);


server.post('/api/messages', connector.listen());

bot.on('conversationUpdate', function (message) {
  if (message.membersAdded) {

    greetings = 'welcome to Joey's Pizza?'

    message.membersAdded.forEach(function (identity) {
      if (identity.id === message.address.bot.id) {
        bot.send(new builder.Message()
          .address(message.address)
          .text(greetings)
        )
      }
    })
  }
});

bot.library(require('./dialogs/reservations').createLibrary());
bot.library(require('./dialogs/order').createLibrary());
bot.library(require('./dialogs/cancellations').createLibrary());
@teamplumaa
Copy link
Author

@stevengum I see that you have provided insights on problems with LUIS in the past, any help will be appreciated

@EricDahlvang
Copy link
Member

EricDahlvang commented Nov 14, 2018

Hi @teamplumaa

Please check out the Contoso Flowers sample's Multi-Dialogs approach using builder.Library:

https://github.com/Microsoft/BotBuilder-Samples/tree/v3-sdk-samples/Node/demo-ContosoFlowers#multi-dialogs-approach

With more explanation found here: https://stackoverflow.com/questions/44098019/ms-bot-builder-how-to-create-a-hierarchical-library-structure


The Microsoft Bot Framework team prefers that how to questions be submitted on Stack Overflow. The GitHub Repository  is the preferred platform for submitting bug fixes and feature requests.  
 
I have closed this issue. Please feel free to resubmit your question over on Stack Overflow and one of our support engineers will help you out as soon as possible.

@teamplumaa
Copy link
Author

@EricDahlvang thanks for the reply.

However, the post does not give any guidelines or path to the answers I was looking for so other recommendations might be appreciated.


The reason for posting here for the second time was that your Support Engineers were not responding via Stack Overflow.

I have been waiting for help with regards to this matter for almost two weeks now, and even though I love MS Botframework, I am close to recommending a different bot framework to the client if LUIS cannot handle subfolders and strictly requires having information all in app.js.

@EricDahlvang
Copy link
Member

I'm sorry you haven't received a response to your Stack Overflow question. Would you please share the link to it here, and I'll make sure someone answers it.

@EricDahlvang
Copy link
Member

Ok, found the SO post: https://stackoverflow.com/questions/53202273/how-can-i-use-luis-in-app-js-to-recognize-dialogs-that-i-have-in-different-folde

I'll see if I can answer this today. Again, I apologize that you have not received an answer yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants