-
Notifications
You must be signed in to change notification settings - Fork 134
Proposal: Stream Tool Arguments #82
Copy link
Copy link
Open
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
Metadata
Metadata
Assignees
Labels
No labels