简体   繁体   English

使Django chatbot应用程序与多个用户交互

[英]making a Django chatbot application interact with multiple users

i have a django chatbot application on web faction shard host. 我在Web派生分片主机上有一个django chatbot应用程序。 the idea is : the chatbot application simulate the customer service in chatting with the customers. 这个想法是:chatbot应用程序在与客户聊天时模拟客户服务。

Basically the conversation will be exchanged through the API using GET and POST, where it first POST the input then GET calls the python file to SELECT the input form the DB and process it then update the database with the retrieved out put.Finally a GET is used to fetch the out put and display it. 基本上,对话将使用GET和POST通过API进行交换,在对话中,它将首先POST输入,然后GET调用python文件从数据库中选择输入并处理它,然后使用检索到的put更新数据库。最后一个GET是用于获取输出并显示它。

so far it is working for one user at a time, what i am considering now is that i want it to chat with multiple customer at the same time an isolating each user. 到目前为止,它一次只为一个用户工作,我现在考虑的是我希望它同时与多个客户聊天,以隔离每个用户。

Do i have to use Redis just for the chatting part, if yes how i can merge it in my project? 我是否仅需要将Redis用于聊天部分,如果可以,我如何将其合并到我的项目中? other there are other solution out there? 其他还有其他解决方案吗?

i have developed it using: 我已经使用它开发了它:

python3: for the chatbot code. python3:用于聊天机器人代码。

Django: for the website. Django:用于网站。

Mysql: for the data base, that hold the knowledge based for the chatbot such as a table that include number of input and it correspond output. Mysql:对于数据库,该数据库包含基于聊天机器人的知识,例如包含输入数量及其对应输出的表格。

Thank you, 谢谢,

You can use Redis,Celery,Python RQ,Rabbit MQ as a queue for distributed tasks(chatting tasks) in your Django app. 您可以将Redis,Celery,Python RQ,Rabbit MQ用作Django应用程序中分布式任务(聊天任务)的队列。 But this will increase complexity in your project. 但这会增加项目的复杂性。 I will recommend you to Develop Python based multi client chat server. 我将建议您开发基于Python的多客户端聊天服务器。

There is a whole chatbot solution based on Python 3 + Django + Mongo/sqlite. 有一个基于Python 3 + Django + Mongo / sqlite的完整的聊天机器人解决方案。 Its github link is https://github.com/gunthercox/ChatterBot . 它的github链接是https://github.com/gunthercox/ChatterBot Hope it can help you. 希望它能对您有所帮助。 This repository also contains Django application example: https://github.com/gunthercox/ChatterBot/tree/master/examples/django_app 该存储库还包含Django应用程序示例: https : //github.com/gunthercox/ChatterBot/tree/master/examples/django_app

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM