系统之家提供 Windows 系统、Ghost 系统、驱动与常用软件的安全下载及安装教程。 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Thinking Mode

发布时间:2026-10-12 | 浏览:1
📥 下载地址(文章开头)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
The DeepSeek model supports the thinking mode: before outputting the final answer, the model will first output a chain-of-thought reasoning to improve the accuracy of the final response. Thinking Mode Toggle and Effort Control ​ (1) Thinking mode is enabled by default, with the default effort being high (2) The mapping between the effort set by the user and the model's actual reasoning effort is as follows: When using Chat Completion with the OpenAI SDK to set the thinking parameter, you need to pass the thinking parameter within extra_body : Input and Output Parameters ​ Thinking mode does not support the temperature , presence_penalty , or frequency_penalty parameters. Please note that, for compatibility with existing software, setting these parameters will not trigger an error but will also have no effect. top_p only takes effect in thinking mode, where the effective range is 0.95 – 1.0 : values below 0.95 are treated as 0.95 . In non-thinking mode it is fixed at 1.0 and your value is ignored. In thinking mode, the chain-of-thought content is returned via the reasoning_content parameter, at the same level as content . In subsequent requests, whether reasoning_content should be passed back and whether it will be concatenated into the context depends on whether the request carries the tools parameter: If the request carries the tools parameter : the reasoning_content of all previous turns should be passed back to the API and will be concatenated into the context. See Tool Calls for details. If the request does not carry the tools parameter : reasoning_content does not need to be passed back; even if passed to the API, it will be ignored and will not be concatenated into the context. See Multi-turn Conversation for details. Multi-turn Conversation ​ In each turn of the conversation, the model outputs the CoT ( reasoning_content ) and the final answer ( content ). If the request does not carry the tools parameter, the CoT content from previous turns will not be concatenated into the context in the next turn, as illustrated in the following diagram:
📥 下载地址(文章中间)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
The following code, using Python as an example, demonstrates how to access the CoT and the final answer, as well as how to concatenate context in multi-turn conversations. The DeepSeek model's thinking mode supports tool calls. Before outputting the final answer, the model can perform multiple turns of reasoning and tool calls to improve the quality of the response. The calling pattern is illustrated below: Please note that for requests carrying the tools parameter, the reasoning_content must be fully passed back to the API in all subsequent requests — even for turns where the model did not perform a tool call. If your code does not correctly pass back reasoning_content , the API will return a 400 error. Please refer to the sample code below for the correct approach. Below is a simple sample code for tool calls in thinking mode: In each sub-request of Turn 1, the reasoning_content generated during that turn is sent to the API, allowing the model to continue its previous reasoning. response.choices[0].message contains all necessary fields for the assistant message, including content , reasoning_content , and tool_calls . For simplicity, you can directly append the message to the end of the messages list using the following code: This line of code is equivalent to: Additionally, in the Turn 2 request, we still pass the reasoning_content generated in Turn 1 to the API. The sample output of this code is as follows: Thinking Mode Toggle and Effort Control Input and Output Parameters Multi-turn Conversation Sample Code Tool Calls Sample Code
📥 下载地址(文章结尾)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等