GithubHelp home page GithubHelp logo

bot-trees-1's Introduction

Bot Trees

This is a sample bot app that uses the bot-graph-dialog extension for dynamically loading graph-based dialogs. Use this app as a reference for using the bot-graph-dialog extension.

Read more about the motivation for developing this extension here

Getting Started

Note- This page assumes you're already familar with the core concepts of bots and how to run them locally on your machine. You'll need to have a bot provisioned in the developer portal. Follow these instructions (look for the Registering your Bot with the Microsoft Bot Framework section) to register your bot with the Microsoft Bot Framework.

git clone https://github.com/CatalystCode/bot-trees.git
cd bot-trees
npm install

Create a config/dev.private.json base on the config/dev.sample.json file. Edit it and add your bot App id and password.

After connecting your bot to this endpoint, run npm start.

Samples

There are a few sample files in the root of this project:

index.js

This is the default sample which loads the different dialogs from the bot/scenarios/dialogs.json file. It adds each of the scenarios on the bot and binds it to the relevant RegEx as defined in the scenario.

loadOnDemand.js

This file demonstrates how to reload scenarios on-demand in cases that a scenario was modified on the backend. In this scenario, if a user was in the middle of a dialog that was updated, he would get a message saying the dialog was changed and that he will need to restart the dialog.

To test this scenario, after starting a dialog such as the stomachPain by sending stomach to the bot:

  1. Answer the first question the bot asks.
  2. Change the version of the stomach pain scenario in the bot/scenarios/stomachPain.json file, and maybe the text of the first question, then save the file.
  3. Browse the following URL http://localhost:3978/api/load/stomachPain to reload the scenario.
  4. Continue the conversation with the bot. You should get a message that the dialog was updated and that you need to start over. You should see the updated question now.

Comment If the version field in the root of the dialog object is specified, this will be considered as the scenario version. If the version was not specified, the bot will assign a version by hashing the content of the json file.

router.js

This file demonstrates how to use LUIS in order to extract a user intent, and then branch to the next scenario based on the result that was received from LUIS.

License

MIT

bot-trees-1's People

Contributors

amiturgman avatar aribornstein avatar morsh 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.