Learn how to trigger client-side events from an agent.
Create a new tool in your agent
Configure the tool
triggerBrowserAlert
message
(string): The message to display in the alert. The LLM should extract relevant text from the conversation, ensuring it is actionable and concise.Implement the client tool in your code
clientTools
name (triggerBrowserAlert
) matches the tool name you set in the agent configuration.message
parameter should align with the agent’s output.Test the client-side event
“Trigger an alert that says ‘Hello World’”You should see a browser alert pop up with the message.
Client tool not triggering
JavaScript errors in the browser