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)
- Message prompt for image should support OpenAI syntax or warn user HOT 5
- Support prompt caching HOT 3
- Override maxToolRoundtrips per tool call HOT 1
- createStructuredFewShot prompt helper
- Error processing an error response HOT 5
- Unable to render "tool running" for client-side tools
- Server-managed state HOT 3
- useChat not sending header options in request HOT 3
- Incorrect Link for Google Vertex AI
- GoogleGenerativeAI crashes when returning value from tool call HOT 1
- Google-Vertex Tool Call Not Recognized in @ai-sdk/google-vertex v0.0.27+ HOT 2
- setThreadId is changing frequently
- generateText: provide roundtrip status HOT 6
- Using experimental_attachments with empty input doesn't append the message HOT 2
- Submit useChat messages as core messages HOT 2
- Tweak documentation for AI SDK UI -> OpenAI Assistants
- Implicit `Buffer` usage fails in Cloudflare Workers HOT 1
- Invalid JSON payload received (Google Provider). HOT 12
- Unable to get 8192 tokens back from claude using streamText() HOT 4
- Composing "streamableUI" elements throws "TypeError: Cannot read properties of null (reading 'children')" HOT 1
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.