Skip to content

BUG: In Gradio_UI, clicking on the "clear" button (the bin icon on the top right) does not reset the agent's history. Here's the fix #1609

@enzomich

Description

@enzomich

Problem
When using Gradio_UI, clicking on the "clear" button (the bin icon on the top right corner) does not reset the agent's history. This means that the only way of starting afresh is to restart the application.

Solution
This can be fixed with a single line of code placed just after after the chatbot = gr.Chatbot(...) call (currently here):

#[...]
                    {"left": r'$', "right": r'$', "display": False},
                ],
            )
            chatbot.clear(self.agent.memory.reset) # <--- NEW: clicking the dustbin button will clear, the agent's memory 
            # Set up event handlers
            text_input.submit(
#[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions