始创于2000年 股票代码:831685
咨询热线:0371-60135900 注册有礼 登录
  • 挂牌上市企业
  • 60秒人工响应
  • 99.99%连通率
  • 7*24h人工
  • 故障100倍补偿

DeepSeek 模型开启关闭思考说明

概念介绍

思考参数(thinking)用于控制模型在响应前是否显示思考过程。该功能适用于需要观察模型推理过程的场景。

DeepSeek V3.1 模型开启思考说明

参数说明

thinking 参数是一个结构,用于配置模型的思考过程。

对象结构:

字段 类型 必填 描述
thinking.type String 用于控制是否显示思考过程。

type 字段可选值:

  • enabled: 强制开启思考过程。
  • disabled: 强制关闭思考过程。

json示例

{
 "model": "deepseek-ai/DeepSeek-V3.1-Terminus",
 ...
 "thinking": {
 "type": "enabled"
 }
}

模型支持情况见下表

  • deepseek-ai/DeepSeek-V3.1
  • deepseek-ai/DeepSeek-V3.1-Terminus

API 接口示例

import json
import requests
 
# 配置API密钥
api_key = "******"  # 替换为你的 APIKEY
url = "https://api.modelverse.cn/v1/chat/completions"
 
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
data = {
 "model": "deepseek-ai/DeepSeek-V3.1-Terminus",  # 指定模型
 "messages": [
 {
 "role": "user",
 "content": [
 {
 "type": "text",
 "text": "9.9和9.11哪个大",  # 用户提问
 }
 ],
 }
 ],
 "thinking": {"type": "enabled"},  # 开启思考功能,可选 enabled  disabled  auto
}
 
try:
 response = requests.post(url, headers=headers, json=data)
 response.raise_for_status() 
 
 print("请求成功!")
 print(json.dumps(response.json(), indent=2, ensure_ascii=False))
 
except requests.exceptions.RequestException as e:
 print(f"请求失败: {e}")
 

DeepSeek V3.2 模型开启思考说明

参数说明

chat_template_kwargs 参数是一个结构,用于配置模型的思考过程。

对象结构:

字段 类型 必填 描述
chat_template_kwargs.thinking Boolean 用于控制是否显示思考过程。

chat_template_kwargs 字段可选值:

  • true: 强制开启思考过程。
  • false: 强制关闭思考过程。

json示例

{
 "model": "deepseek-ai/DeepSeek-V3.2",
 ...
 "chat_template_kwargs": {
 "thinking": true
 }
}

模型支持情况见下表

  • deepseek-ai/DeepSeek-V3.2

API 接口示例

import json
import requests
 
# 配置API密钥
api_key = "******"  # 替换为你的 APIKEY
url = "https://api.modelverse.cn/v1/chat/completions"
 
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
data = {
 "model": "deepseek-ai/DeepSeek-V3.2",  # 指定模型
 "messages": [
 {
 "role": "user",
 "content": [
 {
 "type": "text",
 "text": "9.9和9.11哪个大",  # 用户提问
 }
 ],
 }
 ],
 "chat_template_kwargs": {
 "thinking": true
 }
}
 
try:
 response = requests.post(url, headers=headers, json=data)
 response.raise_for_status()
 
 print("请求成功!")
 print(json.dumps(response.json(), indent=2, ensure_ascii=False))
 
except requests.exceptions.RequestException as e:
 print(f"请求失败: {e}")
 
  • 亿恩北京公司:
  • 经营性ICP/ISP证:京B2-20150015
  • 亿恩郑州公司:
  • 经营性ICP/ISP/IDC证:豫B1-20183354
  • 亿恩南昌公司:
  • 经营性ICP/ISP证:赣B2-20080012
  • 服务器/云主机 24小时售后服务电话:0371-60135900
  • 虚拟主机/智能建站 24小时售后服务电话:0371-60135900
  • 网络版权侵权举报电话:0371-60135995
  • 警情提示:注意防范电信网络诈骗
  • 专注服务器托管25年
    扫扫关注-微信公众号
    0371-60135900
    Copyright© 1999-2026 ENKJ All Rights Reserved 地址:郑州市高新区翠竹街1号总部企业基地亿恩大厦  法律顾问:河南亚太人律师事务所郝建锋、杜慧月律师  B1-20183354   京公网安备41019702002023号 
     

    亿恩公告

     
     
     
     

    0371-60135900
    7*24小时客服服务热线