-
My goal: I'm trying to use the new Agent Chat component in one of my apps as I've built an agent to handle a common workflow. My use case requires the user to be able to clear the chat and start a new session (without refreshing the page)
-
Issue: There doesn't seem to be any method to clear/reset the Agent Chat component, or start a new session. Are there any plans to add this functionality, or am I just missing it somewhere?
-
Additional info: Cloud Retool
Hey welcome back to the Community @jcace! The option to auto clear the LLM Chat component on page load is not available yet. We have a feature request open and I added your +1.
For now, the simplest workaround is to add a short delay, then call clearHistory()
after the component loads. Just a heads up that you may see a quick flash of the previous messages before they clear.
Hope this is helpful, let me know!
Hi @ChiEn , thanks for getting back to me.
Could you please let me know how/where to call this clearHistory()
function? I don't see it in the event handler dropdown, and in a JS Query component it says
agentChat1.clearHistory is not a function
. Attached some screenshots below for context.
@jcace, I'm curious if there's anything preventing you from giving your end users access to the built-in Agent chat to accomplish this task, rather than using the in-app component?
Hey @jcace, I apologize. I misread this. That function was meant for the LLM Chat component and does not work for Agents Chat component. I have filed a feature request internally for you!
In the meantime, could you take a look at @kentβs question? That will help us build a better understanding, thank you!
Thanks @ChiEn !
@kent , our use case is a work order / estimate builder, which we use to build client-facing documents that are exported as PDF once complete.
In the retool app, our team can input line items (SKUs), labour hours and work descriptions - so we've built components for that functionality (for example, "look up product by SKU").
We're exploring the Agent chat component as an "assistant" - the idea is to have it in the sidebar, to help templating out these work orders using prompts. We still need the fine-grained ability to edit individual items - hence using the Agent chat in-app component in a sidebar, instead of just the Agent chat.
Ah makes perfect sense, thank you. For this use case, do you also need the ability to have different chat threads, or is the single chat sufficient? Do you need to pass additional context into the agent chat query (like, for example, table1.selectedRow.someValue
)?
These are the types of things weβre thinking about for the in-app agent chat, so curious for your take.