-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
Description
Currently, execute fires after the full args JSON is parsed. For tools with large text args (email bodies, code), it'd be nice to stream chunks into page UI as the model generates them. example from userland
navigator.modelContext.registerTool({
name: "compose_email",
stream: true,
inputSchema: { /* to, subject, body */ },
execute: async (call) => {
composer.open();
for await (const { key, chunk } of call) {
if (key === "to") composer.appendTo(chunk);
if (key === "body") composer.appendBody(chunk);
}
const { to, subject, body } = await call.args;
return { content: [{ type: "text", text: `Draft created` }] };
}
});For declarative tools this could be default behavior.
Reactions are currently unavailable