百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

ecommerce-chatbot

> 编程语言
开源

一个使用 Microsoft Bot Framework 构建的聊天机器人示例,具有通过 Moltin、Azure 搜索、推荐 API 和 LUIS 提供的电子商务功能

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个使用 Microsoft Bot Framework 构建的聊天机器人示例,具有通过 Moltin、Azure 搜索、推荐 API 和 LUIS 提供的电子商务功能

UPDATE 2/2/2018

  • Updated to use Moltin v2 API to generate search indexes. Please make sure you re-create your Moltin store using the most recent version of the import scripts as there are breaking changes in the data layout.
  • LUIS model was re-exported and is now in the 2.1.0 schema version.
  • Moved from restify to express
  • Also, Microsoft is discontinuing the Recommendations API preview in February 2018. The alternative is to deploy the Recommendations Solution template, but it does not yet support the frequently bought together algorithm that the bot was using. The deployment of a solution template is aslo a more involved process so I decided to drop recommendations for now. The recommendation code is still there and is just not used by the dialog flow at the moment.

Note: the bot is still using the original State API that was deprecated. It works, but the recommendation from Microsoft is to implement a custom state data.

E-Commerce Chatbot

An example of a chatbot built with Microsoft Bot Framework and featuring e-commerce capabilities via:

  • Moltin
  • Azure Search
  • Recommendations API
  • LUIS
  • Text Analytics

I presented this bot on API Strat in Boston as an example of a smart app built with cognitive APIs. This bot is also going to SATURN and SYNTAX.

Video

How To Run

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, and variants. You can find the index definitions and the script that can set up everything you need here
  • Recommendations API endpoint with the FBT (frequently bought together) model trained on historical orders. Here's the instruction on how to set it all up
  • 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 registration
  • MICROSFT_APP_PASSWORD - you will get it from the dev.botframework.com during registration
  • RECOMMENDATION_API_KEY - your API key to the Recommendations API service from the Microsoft Cognitive Services
  • RECOMMENDATION_MODEL- you can create multiple recommendation models and this way you can choose which one the bot will use for suggestions
  • RECOMMENDATION_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 use
  • SEARCH_APP_NAME - the name of your Azure Search service. The code assumes that you have all three indexes in the same Azure Search resource
  • SEARCH_API_KEY- your API key to the Azure Search service
  • LUIS_ENDPOINT - the URL of your published LUIS model. Please keep the Add verbose flag on and remove &q= from the URL. THe bot framework will add it.
  • SENTIMENT_API_KEY - your API key to the Text Analytics service.
  • SENTIMENT_ENDPOINT - the enpoint of yout Text Analytics service. Defaults to https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment

If you would like to connect the Bing Spell Check service, you would do so in LUIS when publishing your endpoint. This integration is transparent to the app and all you do is provision your Azure subscription key to the service and connect it to your LUIS app.

To-Do

  • 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
  • The bot is not multi-lingual

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言