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
orCancel
- 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
- set the endpoint to the domain (http for alpha)
- alpha:
http://${ALPHA_BOT_DOMAIN}:80/api/messages
- else:
http://${BOT_DOMAIN}:443/api/messages
- alpha:
- download ngrok v2 (https://dl.equinox.io/ngrok/ngrok/stable/archive) and configure "Path to ngrok" in Bot Framework Emulator to its location via gear icon at the bottom left
- latest ngrok is incompatible microsoft/BotFramework-Emulator#2399
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
- Setup a local bot instance in https://portal.azure.com/#create/Microsoft.AzureBot
- Configure its App ID and App Password, store them in the .env file
- Setup ngrok to forward to localhost:8080 via
ngrok http 8080 --host-header rewrite
- Set up the ngrok endpoint in Bot Service's Messaging endpoint
- Test in Bot Framework Emulator with the endpoint
https://<ngrok endpoint>/api/messages
and appropriate App ID and App Password. - Configure Webchat Secret (get from Bot Service -> Channel) in your frontend
- Test in Frontend with the Webchat Secret