An example of a chatbot built with Microsoft Bot Framework and featuring e-commerce capabilities via:
I presented this bot on API Strat in Boston as an example of a smart app built with cognitive APIs.
If you would like to run it, you would need:
- A Moltin subscription with the Adventure Works data (I previously shared scripts to import Adventure Works data into Moltin)
- Azure Search service with three indexes -
categories
,products
, andvariants
. You can find the index definitions here and I will soon share the script that creates indexes and loads the data - Recommendations API endpoint with the FBT (frequently bought together) model trained on historical orders. I will soon share the script that loads the data and trains the model
- Trained LUIS model for the intents that require NLU to be recognized. You can import the app that I trained to get a head start
Deploy your bot (I used Azure App Service) and register it with the dev.botframework.com.
Set the following environment variables:
MICROSOFT_APP_ID
- you will get it from the dev.botframework.com during registrationMICROSFT_APP_PASSWORD
- you will get it from the dev.botframework.com during registrationRECOMMENDATION_API_KEY
- your API key to the Recommendations API service from the Microsoft Cognitive ServicesRECOMMENDATION_MODEL
- you can create multiple recommendation models and this way you can choose which one the bot will use for suggestionsRECOMMENDATION_BUILD
- a given model (your product catalog, historical transactions, and business rules) can have multiple recommendation builds and this is how you tell which one the bot will useSEARCH_APP_NAME
- the name of your Azure Search service. The code assumes that you have all three indexes in the same Azure Search resourceSEARCH_API_KEY
- your API key to the Azure Search serviceLUIS_ENDPOINT
- the URL of your published LUIS model (important: microsoft/botframework-sdk#1633)
- The shopping cart is currently kept in the bot's memory (
session.privateConversationData.cart
) and does not sync back to Moltin - Checkout process is not integrated with Moltin
MIT