Skip to content

适配不同 API 的推理模型思维链字段名称 #600

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
jamebal opened this issue May 7, 2025 · 0 comments
Open

适配不同 API 的推理模型思维链字段名称 #600

jamebal opened this issue May 7, 2025 · 0 comments

Comments

@jamebal
Copy link
Contributor

jamebal commented May 7, 2025

感谢作者为推理模型添加了思维链展示功能!🙏 当前实现中,思维链字段名称存在不一致,导致部分 API 的兼容性问题。例如:

  • grok-3-mini-fast-beta 使用 reasoning_content 字段。
  • deepseek/deepseek-r1:free(OpenRouter)使用 reasoning 字段。

希望能统一或适配不同 API 的思维链字段名称,以提高兼容性和一致性。

重现步骤:

  1. 调用 grok-3-mini-fast-beta 模型的 API,响应中思维链字段为 reasoning_content
  2. 调用 deepseek/deepseek-r1:free 模型的 API,响应中思维链字段为 reasoning
  3. 当前代码可能无法统一解析这两种字段,导致部分模型思维链无法正常展示。

示例代码:

  1. grok-3-mini-fast-beta 响应:
{
    "id": "74389f1a-e05a-4bf8-b96e-d83e184c2446",
    "object": "chat.completion.chunk",
    "created": 1746608576,
    "model": "grok-3-mini-fast-beta",
    "choices": [
        {
            "delta": {
                "reasoning_content": " is",
                "role": "assistant"
            },
            "logprobs": null,
            "finish_reason": null,
            "index": 0
        }
    ]
}
  1. deepseek/deepseek-r1:free 响应:
{
    "id": "gen-1746608852-xIwuByvuBWfWfjCmiVvp",
    "provider": "Targon",
    "model": "deepseek/deepseek-r1:free",
    "object": "chat.completion.chunk",
    "choices": [
        {
            "index": 0,
            "delta": {
                "role": "assistant",
                "content": "",
                "reasoning": "得到"
            },
            "finish_reason": null
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant