I am currently implementing a Chatbot purely in python.
In my current implementation, each time the user starts a new chat from a session, another Chatbot instance is launched and hence the Chatbot starts from the initial state.
I wish to change that behaviour and make it similar to let’s say chat on Facebook/Messenger, in which you can seamlessly move between sessions while having a chat without inconsistencies. Namely, I want these attributes:
To implement the first point, I used this example from the django-channels docs and modified it by creating a single group/chatroom for each user. All the sessions from the same user get connected to the same group/chatroom and hence receive all the messages in the group/chatroom regardless of where they were sent from.
However, this implementation currently has a bug. Each time that a user is connected, it initializes a Chatbot instance which starts from the initial state again while the older connections have Chatbot instances that are currently at a different state.
This leads to inconsistent replies which are different based on which window the user typed something in.
Basically instead of having two sessions talk to the same Chatbot instance, we have two sessions talking to two different Chatbot instances and messages from all these four sources are getting added to the same chatroom.
Moreover, we are wasting resources by keeping multiple Chatbot instances per user which increases with the number of currently active sessions.
I want all of the user windows to interact with the same Chatbot instance. What would be the best way to implement that?
Currently I can think of three solutions:
Are there any other solutions possible? What would be the ideal solution?
I am using the following technologies:
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/463657a5-588d-475d-940d-4d7ec0c708d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48d28c1b-651f-4723-aed0-cf811d3bf9f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.