Skip to content

[Bug]DeepSeek V4 API 在 无content + 无tool_calls + 有reasoning 时调用API会400报错 #8482

@renchonghan

Description

@renchonghan

What happened / 发生了什么

Image DeepSeek V4似乎改变了一些策略, 使用过程中Flash和Pro都会400报错

Reproduce / 如何复现?

我并不清楚所有导致的原因, 我只能通过报错分析:
DeepSeek V4 API要求在有 reasoning_content 但没有 content 和 tool_calls的时候, 通过上下文推理的消息不能直接丢弃 (推理模型需要 reasoning 历史), 但 API 要求 content 或 tool_calls 至少有一个, 如果两个都是NULL, 就会直接导致400报错
对话模型使用DeepSeekV4 任意模型

可能的关键性设置:
不显示思考内容 流式输出 在不支持流式输出的平台关闭流式回复

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot v4.25.2
手动部署 于Windows Server DataCenter 2019
API提供商: DeepSeek V4
平台适配器: QQNapcat(OneBot v11)

OS

Windows

Logs / 报错日志

Image

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions