- Issue created by @jan kellermann
- 🇩🇪Germany jan kellermann
The history is also saved in session or database (depending on setting).
I therefore suggest sending an ajax request to delete the history on server. Ideally, this must also be sent to the provider plugin (if it is still storing data - which we have to do in our provider module for Anything LLM).
- 🇬🇧United Kingdom MrDaleSmith
I think this issue should be logged against https://www.drupal.org/project/ai_deepchat → , not here?
- 🇩🇪Germany jan kellermann
I dont think so:
Further development of the AI DeepChat module has been integrated into the
AI module, with AI DeepChat now available as a submodule of the AI module. Please refer to the AI module for continued updates, enhancements, and support. Please also post any issues to the issue queue of the AI module.There is already a ajax callback. I open a feature request to send the ajax-request to the provider, too.
At first glance I cannot find the problem why the session is not cleared.
- Merge request !370Reset message history also when resetting thread. → (Merged) created by jan kellermann
- 🇩🇪Germany jan kellermann
Okay, found it. The history is stored in session, so
$this->resetMessageHistory();
has to be called also.(BTW I dont really understand the interaction of session, thread and tempstore. Why more than one thread if you are in a single user session?)
- 🇩🇪Germany jan kellermann
No, sorry. Test positive but was wrong.
The problem seem that the reset-session is sending and using a thread_id. And the messages for this thread ID will be deleted with the session. But deepchat send no thread ID so all messages are stored without thread_id directly in session - and will not be deleted with reset.
I moved in y new commit the reset button before setting the thread_id. ow the session is cleared.
But I think deepchat should use the thread_id, so this solution is only hotfix.
BTW: Where are the sources for the deepchat.budle.js? I didnt find in source.
- 🇩🇪Germany marcus_johansson
Hi Jan, sorry for not being active here. You found the issue fast, considering the fairly complex decoupling between chatbots, assistant and then possible actions :)
First regarding the the last question - I will add the sources, I forgot to move them from the old deepchat module. The license file should be there already.
Regarding multiple threads - we have prepared it so it can handle threading in the future, meaning that you as a user can have multiple chats going at the same time (and later also persistance), similar to ChatGPT.
So the current options are:
- None - Meaning that not even the last message is taken into context. Its for use cases that are not chatbots.
- Sesssion - one thread per alive window, meaning you can have different discussions in different tabs, browsers or even computers with the same user.
- Sesssion (Same thread on reload) - meaning that it keeps the current thread id and you see the same conversation eveywhere where you are logged in.
But we have added layer on layer here, so I will see if I can refactor it so it make more sense and also document it here: https://project.pages.drupalcode.org/ai/modules/ai_assistant_api/.
I will apply your hotfix to dev for the time being since I tested it and it works. Thank you!
Automatically closed - issue fixed for 2 weeks with no activity.