> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/chat/context-queue.md).

# 長對話、上下文同排隊消息

對話越長，模型要睇嘅歷史就越多。上下文用量接近上限時，較早嘅內容可能冇辦法繼續參與回答。與其不停加一句「繼續」，不如定期整理結論同未決問題。

<figure><img src="/files/6b18f5d00433dc59cbd1ebe4d2d8ff13f42b2b32" alt="助手高级设置中的模型温度和上下文管理选项"><figcaption><p>需要改變回答風格或者長對話處理方式嗰陣先調整進階設定；唔確定時先保留而家個值。</p></figcaption></figure>

## 管理長對話

{% stepper %}
{% step %}

### 1. 觀察上下文提示

當介面提示上下文壓力變大時，先停止加入大型附件，檢查邊啲歷史內容仍然同而家嘅目標有關。
{% endstep %}

{% step %}

### 2. 讓模型生成交接摘要

要求佢分開列出「已確認事實、當前結論、待解決問題、唔可以遺失嘅限制」。呢個比一般嘅「總結一下」更適合繼續做嘢。
{% endstep %}

{% step %}

### 3. 開新話題繼續

將交接摘要同必要文件放入新話題，第一條訊息講明跟住只處理邊個目標。原話題保留作參考。
{% endstep %}
{% endstepper %}

## 使用訊息隊列

模型仲喺度回覆嗰陣，可以將下一條要求加入隊列。適合追加一個清晰嘅後續動作，例如「完成後再整理成三條結論」。如果新消息會改變而家執行緊嘅方向，應先停止當前生成，再重新說明目標。

<figure><img src="/files/9dd2b0517d6a9819477d787edba5f530088adbc2" alt="消息队列中两条待发送消息和恢复自动发送按钮"><figcaption><p>暫停嗰陣可以先核對結果；恢復後，排隊訊息會按照由上至下嘅順序繼續發送。</p></figcaption></figure>

圖中：① 當前話題入面兩條排隊訊息；② 恢復自動發送。恢復後，訊息會按照由上至下嘅順序繼續發送。

{% hint style="info" %}
隊列唔係自動化計劃。佢只負責當前話題入面嘅後續訊息；如果要喺固定時間執行，請用【定時任務】。
{% endhint %}

### 應用案例：審閱一份長報告

先上傳報告並要求按章節列出問題。模型處理時，將「完成後整理風險清單」同「最後生成檢查表」依次加入隊列。需要先核對第一輪結果時，可以暫停自動發送；確認無誤後再恢復。咁樣唔使企喺對話前逐條發送，亦都可以避免下一步要求搶先喺核對之前執行。

<details>

<summary>點解模型會突然忘記前面講過嘅要求？</summary>

先檢查對話係咪過長、係咪轉咗模型，同埋關鍵要求係咪只出現過一次。將穩定規則寫入當前任務嘅明確說明；如果要長期重用，就交畀 Agent 提示詞或者技能。

</details>


---

# 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://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/chat/context-queue.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.
