Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parallel tool calls on client #5516

Open
rclmenezes opened this issue Apr 2, 2025 · 0 comments
Open

Support parallel tool calls on client #5516

rclmenezes opened this issue Apr 2, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@rclmenezes
Copy link

rclmenezes commented Apr 2, 2025

Feature Description

Currently, processChatResponse's onToolCallPart is blocking:

https://github.com/vercel/ai/blob/main/packages/ui-utils/src/process-chat-response.ts#L291-L3](https://github.com/vercel/ai/blob/main/packages/ui-utils/src/process-chat-response.ts#L291-L313)

There's a comment saying "In the future we should make this non-blocking, which requires additional state management for error handling etc."

Use Cases

Parallel tool uses in the client! I'm making a chrome extension that uses Vercel AI and this would be very helpful

Additional context

I'm not entirely sure how to implement this. Maybe we append each tool use to a list of promises in processChatResponse and return once they're all settled?

We could introduce some p-all like functionality to control amount of concurrency as well

@rclmenezes rclmenezes added the enhancement New feature or request label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant