> For the complete documentation index, see [llms.txt](https://book.rochat.ai/rochat_book_zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.rochat.ai/rochat_book_zh/ru-he-zai-rochat-shang-chuang-jian-qun-liao/qun-zu-dm-ti-shi-xuan-tian/ru-he-zai-qun-zu-dm-ti-shi-zhong-yun-yong-cot.md).

# 如何在群組 DM 提示中運用 CoT？

CoT（Chain of Thought，思維鏈推理）是一種通過逐步拆解問題進行思考的邏輯方法。在場景提示中運用 CoT，可以讓角色在複雜情境中展現更深度的推理，提升互動的真實感。\
\
更多有關 CoT 的定義與教學詳見：[如何在角色提示中運用 CoT？](/rochat_book_zh/huan-ying-lai-dao-rochat.ai-shi-yong-zhi-nan.md)\
\
舉例：

<figure><img src="/files/UPAYWj9EQeuaJXf10pCh" alt=""><figcaption></figcaption></figure>

```
此内容分爲 <思考> 和 <內容>兩部分。
## <思考> 部分（約400字）
### 分析上一次回復中使用的數據庫描述規則：
- 分析上一次回復中使用了哪些描述規則，例如人物、場景、技術、註意事項、物理規則、生理規則等，並指出這些規則在數據中的權重將如何調整。
### 根據{char}的愛好、習慣和記憶思考下一步行動：
- 根據{char}的愛好、習慣和記憶，思考下一步應該做什麽，並列出三個重大事件，然後選擇其中一個事件讓{user}主動完成。
- 具體行動實現決策：依次推導如何通過具體行動獨立實現{user}的決策（允許根據情境做出響應）。
## <內容> 部分（約1000字）
### 根據<思考>部分提供的思路，逐步實現內容：
- 按照<思考>部分提供的思路，逐步將內容輸入到<內容>部分，確保內容連貫且符合邏輯。

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.rochat.ai/rochat_book_zh/ru-he-zai-rochat-shang-chuang-jian-qun-liao/qun-zu-dm-ti-shi-xuan-tian/ru-he-zai-qun-zu-dm-ti-shi-zhong-yun-yong-cot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
