Comments (11)
I also have this issue but the weird thing about mine is the same tool is being called twice.
from ai.
It looks like this hardcoded "true" is where the error is happening.
ai/packages/core/rsc/stream-ui/stream-ui.tsx
Line 303 in f7002ad
It's a bad assumption. The tool-call event doesn't immediately mean it's the last render call because there may be multiple tool-call events.
from ai.
A potential fix would be to add a 'all-tool-calls-done' event which gets pushed to stream after the loop right around here:
Then we handle that in stream-ui and finalize the stream there.
The challenge is we'd have to update anything that implements LanguageModelV1 to trigger this event, or version to V2.
from ai.
Another option is to close the stream on finish:
ai/packages/openai/src/openai-chat-language-model.ts
Lines 382 to 388 in f7002ad
Currently not implemented in streamUI:
ai/packages/core/rsc/stream-ui/stream-ui.tsx
Line 314 in f7002ad
from ai.
ah this is the culprit of my issue! been doing this since v3.1.25
from ai.
@mfclarke-cnx can you change this to a bug instead of enhancement?
from ai.
@camwest unfortunately I don't have permissions to change the labels. @lgrammel would you be able to update labels please?
from ai.
As tagged by @bneigher, I have an approach I'm working on in #1904, but it's still a WIP.
Main issue I have right now is that because we don't know how many tool calls will be made ahead of time, the parent "streamableUI" doesn't call .done
until all tool calls complete.
I think my expectation is that the UI will be added to as the final tool calls stream in.
from ai.
Main issue I have right now is that because we don't know how many tool calls will be made ahead of time, the parent "streamableUI" doesn't call
.done
until all tool calls complete.
I think you can get this information at the provider level.
For example the OpenAI provider passes an array of tool_calls so you know when you're finished iterating that it's 'done'
from ai.
"Parallel support, how to resolve the 'done' error bug now."
from ai.
Maybe anybody knows how to tune the prompt so the model doesnot put number of tools to call at the same time?
from ai.
Related Issues (20)
- Add Azure Extensions to the Azure provider
- Add support for edit history
- Create a tool to summarise results HOT 6
- AI_TypeValidationError: Optional type validation in generateObject function. HOT 13
- Model Registry non-standard parameters
- Cannot use zod tuple() in tool schema HOT 2
- Vercel AI SDK Incompatibility with Latest Perplexity API Updates HOT 2
- stop_sequences HOT 1
- json mode HOT 3
- experimental_useObject onFinish
- Increased Token Limit Not Working with Claude 3.5 Sonnet HOT 4
- Let AI use multiple times tools before answering HOT 3
- Add `baseURL` and `apiVersion` to the Azure OpenAI Provider HOT 1
- Text chunk JSON parsing error HOT 2
- set createAt timestamp for user messages when they are created HOT 10
- Export utils to parse AI stream responses on the client HOT 2
- 'InvalidToolArgumentsError' error is thrown to parent scope in streamUi
- Encounter Runtime timeout error when returning early in server action HOT 2
- azure api version as env var HOT 4
- Pass `detail` parameter to `ImagePart` in `CoreUserMessage` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ai.