Hi GD team, I embedded <gd-ai-assistant> web...
# gooddata-ui
v
Hi GD team, I embedded <gd-ai-assistant> web component into my Angular app. It works just fine but I don't see that Reset icon. How can I reset the chat? Is there a list of available actions (if any)?
k
If you have embedded the
<gd-ai-assistant>
web component in your Angular app and do not see the Reset icon, you can still programmatically reset the chat using the available API actions. ### How to Reset the Chat You have two main options: #### 1. Use the ChatThread API If you have access to the backend instance, you can reset the chat thread like this:
Copy code
javascript const chatThread = backend.workspace(workspaceId).genAI().getChatThread(); await chatThread.reset();
This will reset the conversation for the specified workspace. [Reference: Resetting the chat thread](https://www.gooddata.com/docs/gooddata-ui/latest/references/embed_ai_assistant/#resetting-the-chat-thread) #### 2. Use the
clearThreadAction
with the Dispatcher If you are using the Gen AI UI SDK, you can dispatch the
clearThreadAction
to reset the chat:
Copy code
javascript import { clearThreadAction } from "@gooddata/sdk-ui-gen-ai";  // Retrieve dispatcher from chat UI dispatcher(clearThreadAction());
[Reference: Actions that are now available](https://www.gooddata.com/docs/gooddata-ui/latest/references/embed_ai_assistant/#actions-that-are-now-available) ### List of Available Actions -
clearThreadAction
– resets the chat thread. -
newMessageAction
– adds a message to the stack and gets a response from the assistant. You can use these actions with the dispatcher from the chat UI as shown above. ### Additional Notes - The reset icon is available in the default UI, but if you do not see it in your embedded scenario, using the programmatic options above is the recommended approach. - The
<gd-ai-assistant>
component also emits events such as
chatReset
, which you can listen for if you want to trigger custom logic in your Angular app. [Reference: AI Assistant custom element events](https://www.gooddata.com/docs/gooddata-ui/latest/learn/web_components/ai_assistant_custom_element/) If you need to trigger the reset from your own UI (e.g., a button in your Angular app), you can call these methods/actions in response to your button click.
m
Hi @Victor Bjorn, could you confirm the question here was answered to your satisfaction? If you need further help, don't hesitate to let us know.
1