"use client"; import { defineToolkit, useAui, AuiProvider, Suggestions, Tools, } from "@assistant-ui/react"; import { Thread } from "@/components/assistant-ui/thread"; import { PlusIcon } from "lucide-react"; const toolkit = defineToolkit({ browser_alert: { description: "Display a native browser alert dialog to the user.", parameters: { type: "object", properties: { message: { type: "string", description: "Text to display inside the alert dialog.", }, }, required: ["message"], }, execute: async ({ message }) => { alert(message); return { status: "shown" }; }, render: ({ args, result }) => (
browser_alert
Requested alert with message: {JSON.stringify(args.message)}
{result?.status === "shown" && (Alert displayed in this tab.
)}