# 多層對話模組

大家對於聊天機器人的第一個想像一定是和機器人互動對話吧！

但是聊天機器人不如ChatGPT這麼聰明，所有問題都能夠解答

所以事先設定好引導的答案很重要，能夠順利和好友達成互動感

***

以下我們就針對一種情境，提供兩個變化的對話模組結構做教學

> 情境：
>
> 我們想利用機器人和好友互動取得好友基本資訊

建議大家可以先畫出樹狀圖，了解互動的流程怎麼進行

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

根據上方的流程，可以知道總共會有三個階段

1. 詢問性別
2. 詢問喜歡的商品
3. 感謝回答

這時候我們應該建立三個對話模組

模組之間記得設定按鈕：回覆設定「對話模組」並選擇好對應的模組

每個按鈕也都可以設定自動標籤，輕鬆記錄好友資訊唷

分別如下

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

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

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

***

但如果我們給不同性別不同的商品選項的話，樹狀圖會變成

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

1. 詢問性別
2. 詢問喜歡的商品(男性、女性)
3. 感謝回答

變成了四個區塊，因此我們應該要建立四個對話模組

分別如下(左右維持相同模組，中間的模組必須區分為男性和女性)

<figure><img src="/files/heOvwuMeqxgru0KuKW8S" alt="" width="188"><figcaption><p>選擇男性的流程1 </p></figcaption></figure>

<figure><img src="/files/4n1DR44YAMKJrh0SLAxd" alt="" width="188"><figcaption><p>選擇男性的流程2</p></figcaption></figure>

<figure><img src="/files/U92fdAsqnTWFJSdhaxuN" alt="" width="188"><figcaption><p>選擇男性的流程3</p></figcaption></figure>

<figure><img src="/files/cSDeS45et1PI3ieoVTaY" alt="" width="188"><figcaption><p>選擇女性的流程1</p></figcaption></figure>

<figure><img src="/files/Z77Q6SVPAJddlTEyyaFm" alt="" width="188"><figcaption><p>選擇女性的流程2</p></figcaption></figure>

<figure><img src="/files/IavDkRw6SzuSf21Z2FEn" alt="" width="188"><figcaption><p>選擇女性的流程3</p></figcaption></figure>

所以根據不同的互動流程，分支可能需要更多模組

開始動手規劃看看吧～ 有趣的互動才是創造品牌與眾不同的關鍵唷～

有任何問題都可以利用各大社群平台和我們詢問唷！

### 馬上註冊MantaGO吧！


---

# Agent Instructions: 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:

```
GET https://blog.mantago.cc/zh/dui-hua-mo-zu/duo-ceng-dui-hua-mo-zu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
