You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My first tool call is happening as expected, but the consecutive call is returning this error The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done()
const { value: stream } = await streamUI({
model: google('gemini-1.5-flash-latest'),
system: \ - you are a friendly assistant - you are concise with your responses - you do not use lists ,
messages: messages.get() as CoreMessage[],
text: async function* ({ content, done }) {
if (done) {
messages.done([
...(messages.get() as CoreMessage[]),
{ role: "assistant", content },
]);
contentStream.done();
} else {
contentStream.update(content);
}
return textComponent;
},
tools: {
viewUsage: {
description: "view current usage for youtube",
parameters: z.object({
type: z.enum(["youtube"]),
}),
generate: async function* ({ type }) {
const toolCallId = generateId();
messages.done([
...(messages.get() as CoreMessage[]),
{
role: "assistant",
content: [
{
type: "tool-call",
toolCallId,
toolName: "viewUsage",
args: { type },
},
],
},
{
role: "tool",
content: [
{
type: "tool-result",
toolName: "viewUsage",
toolCallId,
result: `The current usage for ${type} is currently displayed on the screen`,
},
],
},
]);
return (
<Message role="assistant" content={<UsageView type={type} />} />
);
},
},
})
Additional context
I am using gemini-1.5-flash-latest. Hope it is not something to do with the provider or model
The text was updated successfully, but these errors were encountered:
Description
My first tool call is happening as expected, but the consecutive call is returning this error
The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done()
My code can be found here
I am following the next.js template for rsc-preview https://github.com/vercel-labs/ai-sdk-preview-rsc-genui
Code example
const contentStream = createStreamableValue("");
const { value: stream } = await streamUI({
model: google('gemini-1.5-flash-latest'),
system:
\ - you are a friendly assistant - you are concise with your responses - you do not use lists
,messages: messages.get() as CoreMessage[],
text: async function* ({ content, done }) {
if (done) {
messages.done([
...(messages.get() as CoreMessage[]),
{ role: "assistant", content },
]);
})
Additional context
I am using
gemini-1.5-flash-latest
. Hope it is not something to do with the provider or modelThe text was updated successfully, but these errors were encountered: