Replies: 5 comments 5 replies
-
Have you updated |
Beta Was this translation helpful? Give feedback.
-
I am using these packages: "@ai-sdk/anthropic": "^0.0.24", "@ai-sdk/openai": "^0.0.33", "ai": "^3.2.10", "zod": "^3.23.8". Code initiating streaming looks like this:
It seems to fail silently for a while; eventually I get an error
|
Beta Was this translation helpful? Give feedback.
-
Interesting - it actually appears that when used with await streamUI() that things work fine with anthropic, but not when using await streamObject() |
Beta Was this translation helpful? Give feedback.
-
any ideas for what might be the issue with streamObject() (only with Anthropic not OpenAI) when streamUI() working fine with Anthropic? Many thx! |
Beta Was this translation helpful? Give feedback.
-
Can confirm this issue still exists. I opened an issue here with more details. Wonder if anyone found a workaround for this. |
Beta Was this translation helpful? Give feedback.
-
In the documentation it says that: "Anthropic language models can also be used in the streamText, generateObject, streamObject, and streamUI functions (see AI SDK Core and AI SDK RSC)."
until now I've worked only with OpenAI models with the streamUI function and everything worked flawlessly, I want to try anthropic models now, but it looks like the "model" property in the streamUI options can't use the anthropic provider (even though the docs says it does), this is the error: "Type 'AnthropicMessagesLanguageModel' is not assignable to type 'LanguageModelV1'."
const result = await streamUI({
system,
model: anthropic('claude-3-haiku-20240307'),
maxTokens: 1024,
messages: [...history.get()],
text: ({ content, done }) => {...},
tools: {...}
temperature: 0,
});
return {... };
}
what am I missing here?
Beta Was this translation helpful? Give feedback.
All reactions