Skip to content

fix(deepseek): prevent incorrect ToolCall merging caused by empty id and name strings #3298

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ggndnn
Copy link

@ggndnn ggndnn commented May 23, 2025

Fix tool call merging issue during deepseek stream processing, same as #2589.

@markpollack
Copy link
Member

@mxsl-gr thoughts?

@mxsl-gr
Copy link
Contributor

mxsl-gr commented May 30, 2025

Hi, @ggndnn Thanks for the PR!
I’ve done quite a few tests, and both deepseek-chat and ZhiPuAI in stream mode don’t seem to return an empty string for the tool call id.
It seems like this issue might be specific to OpenAI, If you have a minimal reproducible scenario, that would be even better!

@ggndnn
Copy link
Author

ggndnn commented May 30, 2025

@mxsl-gr Hi, In order to obtain the reasoning_content while also utilizing the tool calling feature, I believe the DeepSeekApi is capable of doing so, so I used it to access aliyun models such as qwen3-235b-a22b, then got the issue.

@mxsl-gr
Copy link
Contributor

mxsl-gr commented May 30, 2025

@mxsl-gr Hi, In order to obtain the reasoning_content while also utilizing the tool calling feature, I believe the DeepSeekApi is capable of doing so, so I used it to access aliyun models such as qwen3-235b-a22b, then got the issue.

You’re right! I tested it with Qwen3 and saw the same issue.
It related to the model’s default return values. From a defensive programming perspective, I think this merge change doesn’t hurt and can be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants