IcaliaLabs / alpha

Craft your own web-based chatbot
MIT License
138 stars 76 forks source link

Customize bot with dialog models running in Python #22

Closed huiwugit closed 6 years ago

huiwugit commented 6 years ago

Hi, thank you for the great chatbot design! I am trying to connect your chatbot interface with my own backend dialog models (using Pytorch) written in Python. I am wondering what are the right tools I should use to get the job done?

(I don't have experience with Javascript and web development. My background is machine learning and computer vision research.)

Running time, efficiency are not my primary concern; but rather I am looking for the quickest way to connect the interface with my Python application, which will in real time read the user dialogs and suggest images and recommendations.

CharlieIGG commented 6 years ago

Hey @huiwugit, this app uses Redux as its main state management tools, therefore we suggest you use Sagas in order to drive any async actions to the bot.

Currently this repo has the bot using some static dialog trees (see the BotMind folder) to generate dialog flows, but you can as easily substitute them with your own Python-driven service.

Take a look at app/containers/BotContainer/sagas.js, we're doing pretty much what you need to do, but calling an internal file instead of an external endpoint.

For further reference as to how to use Sagas see here: https://github.com/redux-saga/redux-saga

This repo is based off a very rich boilerplate, so you should also take a look there: https://github.com/react-boilerplate/react-boilerplate