Git Product home page Git Product logo

luis-nodejs-bot-jspruance's Introduction

Basic Bot template

This bot has been created using Microsoft Bot Framework,

This samples shows how to:

  • Use LUIS to implement core AI capabilities
  • Implement a multi-turn conversation using Dialogs
  • Handle user interruptions for such things as Help or Cancel
  • Prompt for and validate requests for information from the user

Prerequisite to run this bot locally

  • Download the bot code from the Build blade in the Azure Portal

  • Create a file called .env in the root of the project and add the botFilePath and botFileSecret to it

    • You can find the botFilePath and botFileSecret in the Azure App Service application settings
    • Your .env file should look like this
      botFilePath=<copy value from App settings>
      botFileSecret=<copy value from App settings>
  • Run npm install in the root of the bot project

  • Finally run npm start

Testing the bot using Bot Framework Emulator

Microsoft Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator from here

Connect to bot using Bot Framework Emulator v4

  • Launch the Bot Framework Emulator
  • File -> Open bot and navigate to the bot project folder
  • Select <your-bot-name>.bot file

Deploy this bot to Azure

See here to learn more about deploying this bot to Azure and using the CLI tools to build the LUIS models this bot depends on.

Further Reading

Additional Resources

Dependencies

  • Restify Used to host the web service for the bot, and for making REST calls
  • dotenv Used to manage environmental variables

Project Structure

index.js references the bot and starts a Restify server. bot.js loads the dialog type you selected when running the generator and adds it as the default dialog.

Configuring the bot

Update .env with the appropriate keys botFilePath and botFileSecret.

  • For Azure Bot Service bots, you can find the botFileSecret under application settings.
  • If you use MSBot CLI to encrypt your bot file, the botFileSecret will be written out to the console window.
  • If you used Bot Framework Emulator V4 to encrypt your bot file, the secret key will be available in bot settings.

Running the bot

node ./index.js

Developing the bot

nodemon ./index.js

luis-nodejs-bot-jspruance's People

Contributors

jspruance avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.