hi , i have created a sample bot and integrated with LUIS by creating intents and mappings, u see can code in below screen shot, the issue is i could not get response from bot to Emulator.
/-----------------------------------------------------------------------------
A simple echo bot for the Microsoft Bot Framework.
-----------------------------------------------------------------------------/
var restify = require('restify');
var builder = require('botbuilder');
var botbuilder_azure = require("botbuilder-azure");
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
appId: '',
appPassword: '',
openIdMetadata: process.env.BotOpenIdMetadata
});
// Listen for messages from users
server.post('/api/messages', connector.listen());
var tableName = 'botdata';
var azureTableClient = new botbuilder_azure.AzureTableClient(tableName,process.env.AzureTableName);// process.env.AzureTableKeyprocess.env['AzureWebJobsStorage']
var tableStorage = new botbuilder_azure.AzureBotStorage({ gzipData: false }, azureTableClient);
// Create your bot with a function to receive messages from the user
var bot = new builder.UniversalBot(connector);
bot.set('storage', tableStorage);
// Make sure you add code to validate these fields
var luisAppId ='XXXXXXXXXXXXXXXXXXXXXXXXXXX';
var luisAPIKey ='XXXXXXXXXXXXXXXXXXXXXXXXXXX';
var luisAPIHostName = process.env.LuisAPIHostName || 'westus.api.cognitive.microsoft.com';
@ajaykumar1452 Would you please post this question in the main botbuilder repository. We will be happy to assist you over there in diagnosing your issue.
hi , i have created a sample bot and integrated with LUIS by creating intents and mappings, u see can code in below screen shot, the issue is i could not get response from bot to Emulator.
----------------------------------Emulator--------------------------------------
below is the code for above screen shot.
/----------------------------------------------------------------------------- A simple echo bot for the Microsoft Bot Framework. -----------------------------------------------------------------------------/
var restify = require('restify');
var builder = require('botbuilder'); var botbuilder_azure = require("botbuilder-azure");
// Setup Restify Server var server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3978, function () { console.log('%s listening to %s', server.name, server.url); });
// Create chat connector for communicating with the Bot Framework Service var connector = new builder.ChatConnector({ appId: '', appPassword: '', openIdMetadata: process.env.BotOpenIdMetadata });
// Listen for messages from users server.post('/api/messages', connector.listen());
/*----------------------------------------------------------------------------------------
var tableName = 'botdata'; var azureTableClient = new botbuilder_azure.AzureTableClient(tableName,process.env.AzureTableName);// process.env.AzureTableKeyprocess.env['AzureWebJobsStorage'] var tableStorage = new botbuilder_azure.AzureBotStorage({ gzipData: false }, azureTableClient);
// Create your bot with a function to receive messages from the user var bot = new builder.UniversalBot(connector); bot.set('storage', tableStorage);
// Make sure you add code to validate these fields var luisAppId ='XXXXXXXXXXXXXXXXXXXXXXXXXXX'; var luisAPIKey ='XXXXXXXXXXXXXXXXXXXXXXXXXXX'; var luisAPIHostName = process.env.LuisAPIHostName || 'westus.api.cognitive.microsoft.com';
const LuisModelUrl = 'https://' + luisAPIHostName + '/luis/v1/application?id=' + luisAppId + '&subscription-key=' + luisAPIKey;
// Main dialog with LUIS //console.log(LuisModelUrl); var recognizer = new builder.LuisRecognizer(LuisModelUrl);
var intents = new builder.IntentDialog({ recognizers: [recognizer] }) .matches("weather",(session,args)=>{ console.log(JSON.stringify(args));
}) .matches('greeting',(session,args)=>{
}) .onDefault((session) => { session.send('Sorry, I did not understand \'%s\'.', session.message.text); });
bot.dialog('/', intents);