Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command to clear chat message history #616

Closed
michaelchia opened this issue Feb 2, 2024 · 7 comments · Fixed by #943 or #951
Closed

New command to clear chat message history #616

michaelchia opened this issue Feb 2, 2024 · 7 comments · Fixed by #943 or #951
Assignees
Labels
enhancement New feature or request @jupyter-ai/chatui

Comments

@michaelchia
Copy link
Collaborator

Problem

/clear command does not clear the default and ask chat handler memory. Given that it clears the window I would expect it to clear the memory as well.

If this is intentional, consider adding a new command (perhaps /new) to refresh the chat.

Proposed Solution

Have /clear somehow call DefaultChatHandler.clear_memory and an equivalent in AskChatHandler. Would probably require altering BaseChatHandler to allow chat handlers to have access to other chat handlers. Could do so be by adding the AiExtension.settings["jai_chat_handlers"] dict as a param in BaseChatHandler.

Additional context

Related to #428. Although this seems to assume /clear clears the default chat handler memory, which it does not.

@michaelchia michaelchia added the enhancement New feature or request label Feb 2, 2024
@JasonWeill
Copy link
Collaborator

In magic commands, we formerly used the -r (reset) option to remove history. This was removed in #551, when we removed message history from OpenAI providers in magic commands. We still use message history in the chat UI, so perhaps a new /reset command would be good to add.

@JasonWeill JasonWeill changed the title /clear to also clear memory New command to clear chat message history Feb 5, 2024
@JasonWeill
Copy link
Collaborator

After discussing this with my colleagues, a new command, perhaps called /reset, would be best for this use case. Thank you for opening this issue!

@dlqqq dlqqq self-assigned this Feb 19, 2024
@michaelchia
Copy link
Collaborator Author

Hello @dlqqq, any estimation on when this would be added? If it is going to be a while I'll need to hack a workaround in the meantime.

@labarba
Copy link

labarba commented Jun 1, 2024

I landed here in my search for an answer to the question: how does one clear the chat history to start a brand new interaction with the AI model? Is the only way currently to exit JupyterLab and start a brand new session? This is disruptive in my current state, where I have one notebook that I've been working over some time, with many calls via %%ai magics (and a state holding outputs from those calls), and did some side work in another notebook which involved many calls to the AI model via the chat interface. Finished with this side work, I'd like to not have a long chat history persisting in my current session when I go back to continue working on the first notebook.

@labarba
Copy link

labarba commented Jun 1, 2024

Oh, following the linked issue #716 I see that I can temporarily change model for a chat reset as side effect! 😅

@michaelchia
Copy link
Collaborator Author

@dlqqq @JasonWeill Actually, instead of a /reset command, could we look toward a new convo button (+) and some convo selection/management button at the top bar next to the settings gear. This seems to be the standard, as seen in most of the other code chat assistant IDE plugins.

@JasonWeill
Copy link
Collaborator

@michaelchia The idea of having multiple conversations, perhaps in "threads" (Slack or Discord style) or in "conversations" (ChatGPT style) has come up before, but I didn't see an issue articulating our past discussions. Could you please open a new issue with info about how you would like to see this feature? Some visual mocks or screenshots of UI concepts would help out. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request @jupyter-ai/chatui
Projects
None yet
4 participants