/VestBot

Bot created with MS Bot Framework

Primary LanguageTypeScript

VestBot

Serve stock queries

This bot has been created using Bot Framework, it shows how to:

  • Use CLU 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

Prerequisites

Testing

Testing in local

copy sample.env to .env and fill in the values

Testing in alpha

Alpha is a staging environment for testing. It retrieves server secrets from Secrets Manager in beta AWS account. Because it is served on HTTP via load balancer listener endpoint, it is not registered to Azure Bot Service and cannot be tested via frontend. It can however be tested in Bot Framework Emulator. See Connecting to a deployed bot

Overview

This bot uses CLU, an AI based cognitive service, to implement language understanding.

  • Node.js version 10.14.1 or higher

    # determine node version
    node --version

To run the bot

  • Install modules

    npm install
  • Build the bot source code

    npm run build
  • Setup CLU

  • Start the bot

    npm start

Testing the bot using Bot Framework Emulator

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 version 4.9.0 or greater from here

Connect to the bot using Bot Framework Emulator

  • Launch Bot Framework Emulator
  • File -> Open Bot
  • Enter a Bot URL of http://localhost:8080/api/messages

Connecting to a deployed bot

Connecting to local bot via Bot Service

When you need to route frontend to the local version of backend, it needs to go through Azure Bot Service

  1. Setup a local bot instance in https://portal.azure.com/#create/Microsoft.AzureBot
  2. Configure its App ID and App Password, store them in the .env file
  3. Setup ngrok to forward to localhost:8080 via ngrok http 8080 --host-header rewrite
  4. Set up the ngrok endpoint in Bot Service's Messaging endpoint
  5. Test in Bot Framework Emulator with the endpoint https://<ngrok endpoint>/api/messages and appropriate App ID and App Password.
  6. Configure Webchat Secret (get from Bot Service -> Channel) in your frontend
  7. Test in Frontend with the Webchat Secret

Further reading