-
Notifications
You must be signed in to change notification settings - Fork 630
Open
Description
Hey - so I was able to successfully create a button and an action. I can see the LLM attaching the action to the button in the form of ... on: { press: { action }}
However I'm unable to understand what should I send in the emit fn call?
catalog:
actions: {
openLink: z.object({
url: z.string().describe("The URL to open"),
}),
}
registry:
Button: ({ props, emit }) => (
<button onClick={() => emit?.("??")}>
{props.label}
</button>
),
component:
const handlers = {
openLink: (params: any) => {
const { url } = params as { url: string };
window.open(url, "_blank", "noopener,noreferrer");
},
<ActionProvider handlers={handlers}>
<Renderer spec={spec} registry={registry} loading={isStreaming} />
</ActionProvider>
At a high level what Im trying to do is generate a button that can be clicked to open a website
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels