> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socialvision.tisyk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# AI 返回字段：思考相关

> 使用帮助：AI 返回字段：思考相关

部分推理 / 思考类模型会在响应中附带「思考」内容（reasoning / thinking）。不同厂商字段名不同，接入时请按模型文档解析，不要假定只有一种结构。

## 常见形态

### 1. OpenAI 兼容 · `reasoning_content` / `reasoning`

部分兼容接口在 `choices[].message` 中增加：

```json theme={null}
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "最终回答…",
        "reasoning_content": "中间推理过程…"
      }
    }
  ]
}
```

* **展示给终端用户**：通常只用 `content`。
* **调试 / 审计**：可记录 `reasoning_content`（注意隐私与成本日志体积）。

### 2. 独立 `thinking` / `thought` 块

部分原生协议（如部分 Gemini / Anthropic 风格适配）会把思考放在独立 part 或独立字段中。请以对应平台 OpenAPI 的 response schema 为准。

### 3. 流式（SSE）

流式场景下思考与正文可能分多帧到达：

1. 先收到 reasoning / thinking delta
2. 再收到最终 `content` delta
3. 以 `data: [DONE]` 或厂商约定结束帧收尾

客户端应**按帧累加**对应字段，避免把思考拼进最终回答展示区。

## 计费与可见性

| 项 | 说明 |
| - | - |
| Token 计量 | 思考内容通常计入输入或输出 token（以模型/渠道说明为准） |
| 空思考 | 部分模型可关闭思考或思考为空；不要因字段缺失直接报错 |
| 安全 | 不要把完整思考日志暴露给不可信前端 |

## 接入建议

1. 先看目标模型在门户对应平台页的 **response 示例**。
2. UI 默认折叠思考区，仅展示 `content`。
3. 若字段缺失，回退为只渲染 `content`，不要阻断主流程。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.