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

🐞 Model tried to call unavailable tool 'multi_tool_use.parallel' | Data stream has already been closed. #3876

Open
oalexdoda opened this issue Nov 25, 2024 · 3 comments
Labels
ai/provider bug Something isn't working

Comments

@oalexdoda
Copy link

Description

This is an inconsistent bug, but it triggers around 10% of the time. First, there's no error being thrown (maybe due to this #3875). And if you add a console.error in that dist, here's the error being thrown server-side:

image

Code example

image

AI provider

"@ai-sdk/openai": "^1.0.4",

Additional context

It seems to happen when using a bunch of tools & streaming to useChat.

@oalexdoda oalexdoda added the bug Something isn't working label Nov 25, 2024
@oalexdoda
Copy link
Author

oalexdoda commented Nov 25, 2024

I also noticed that the content comes through as empty for chats that error out, so maybe it's related to this? #3263 (comment)

Using node v20.16.0

Edit 1: Noticed that when it errors out & you enable error streaming to the client, it throws this:
Model tried to call unavailable tool 'multi_tool_use.parallel'.

I wonder if it's a tool hallucination coming from OpenAI?

Edit 2: Is there a way to turn off parallelToolCalls on streamText / useChat / result.toDataStreamResponse?

@oalexdoda oalexdoda changed the title Data stream has already been closed. Model tried to call unavailable tool 'multi_tool_use.parallel' | Data stream has already been closed. Nov 25, 2024
@oalexdoda oalexdoda changed the title Model tried to call unavailable tool 'multi_tool_use.parallel' | Data stream has already been closed. 🐞 Model tried to call unavailable tool 'multi_tool_use.parallel' | Data stream has already been closed. Nov 25, 2024
@lgrammel
Copy link
Collaborator

@oalexdoda you can turn off parallel tool calls for openai models in the model settings: https://sdk.vercel.ai/providers/ai-sdk-providers/openai#chat-models

@oalexdoda
Copy link
Author

@oalexdoda you can turn off parallel tool calls for openai models in the model settings: https://sdk.vercel.ai/providers/ai-sdk-providers/openai#chat-models

Perfect, thanks @lgrammel - will try that asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/provider bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants