Comments (12)
As a kind of "workaround" you can set parallelToolCalls
to false
(as introduced in #1937) — but lack of parallel tool calling support really should be mentioned on https://sdk.vercel.ai/docs/troubleshooting/common-issues
Frustrating that this common benefit of AI tool calling is broken on Vercel AI UI :(
from ai.
I also have this issue but the weird thing about mine is the same tool is being called twice.
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.
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.
"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)
- generateObject fails with any Perplexity api models HOT 3
- `useObject` doesn't work properly when the LLM throws an error HOT 1
- Sveltekit handleSubmit sends back data as undefined HOT 1
- Tools call is triggered, but the new tools format does not execute the code. HOT 6
- When using streamUI, I need to be able to update the ui from onFinish HOT 1
- When using tools, I get a 'ui stream is already closed' HOT 3
- experimental_useObject to include attachments HOT 2
- ReferenceError: performance is not defined HOT 3
- Functions import from OpenAPI spec
- Get the traceId, (telematry data) sent back from function result. HOT 1
- When providing image message to any groq model, it throws `message[0].content must be a string` HOT 4
- Invalid data content. Content string is not a base64-encoded media. HOT 2
- Provide provider chat id and timestamp HOT 1
- Large amounts of Suspense leading to browser crashing/max call stack error HOT 1
- Prompt Token Usage not accurate when using Anthropic Prompt Caching HOT 1
- add tool roundtrips to streamUI HOT 6
- Example code using AI State breaks when sending follow-up user message in conversation
- useChat maxRoundTrips breaks in 3.3.21 HOT 6
- Enable dynamic handling of maxTokens limits across embed() models with 1. a utility to count tokens and 2. options to automatically truncate or 3. chunk provided strings HOT 1
- infer correct return types when using `output: 'array'` with `experimental_useObject` HOT 4
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.