Skip to content

希望添加可选的 Thinking 关闭功能 #8

Description

@zzhx2006

注意到 GLM、Deepseek 等提供商支持开启/关闭 Thinking 功能,虽然不是 OpenAI 兼容的。

用法示例如下:

curl --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "glm-5.1",
  "messages": [
    {
      "role": "system",
      "content": "你是一个有用的AI助手。"
    },
    {
      "role": "user",
      "content": "请介绍一下人工智能的发展历程。"
    }
  ],
  "stream": true,
  "temperature": 1,
  "thinking": {
    "type": "disabled"
  }
}
'

详情可参见 GLM API 文档

实现原理不难,只需要在 POST 请求中提供 "thinking": {"type": "disable"} 即可。

感谢 @NitroRCr 为开源社区的无私贡献!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions