EmotionSupport¶
Goals¶
EmotionSupport 為系統的情緒安撫模組。 負責承接 previous_module_outputs 的語氣,具體點出使用者情緒、正常化感受,並溫柔引導到後續步驟。
是一個 dspy module。
Inputs¶
| Input | Type | 說明 |
|---|---|---|
user_input | string | 使用者輸入文字,會被傳給 EmotionSupport 處理(必填)。 |
dialog_history | string | 對話歷史(選填,預設空字串)。 |
previous_module_outputs | string | 前面模組(如 Router)的輸出。 |
pipeline_history | string | 已執行的模組與後續步驟。 |
Outputs¶
| 欄位 | 型別 | 說明 |
|---|---|---|
emotion_reply | string | 完整的情緒回應文字。 |
signature¶
emotion_support¶
Goal¶
承接語氣、點出情緒、正常化感受、溫柔過渡到後續步驟,並用輕鬆小問題收尾。
Inputs¶
| Input | Type | 說明 |
|---|---|---|
dialog_history | string | 對話歷史(選填,預設空字串)。 |
user_input | string | 使用者這一輪的完整輸入文字(必填)。 |
previous_module_outputs | string | 前面模組(如 Router)的輸出。 |
pipeline_history | string | 已執行的模組與後續步驟。 |
Outputs¶
回傳型態:dspy.Prediction,包含以下欄位:
| 欄位 | 型別 | 說明 |
|---|---|---|
emotion_reply | string | 一段溫柔、具體、正常化情緒的回應,並自然銜接 pipeline_history 的下一步。 |
Workflow & Upstream Mapping¶
EmotionSupport 會根據 previous_module_outputs 與 pipeline_history,產生一段溫柔的情緒安撫回應,並自然引導到後續步驟。
flowchart TD
U["使用者輸入"] --> E["情緒偵測與共感"]
E --> N["正常化感受"]
N --> S["小建議/過渡語"]
S --> Q["開放式小問題收尾"]
Q --> R["輸出 emotion_reply"] 使用範例¶
emotion = EmotionSupportModule()
result = emotion(
user_input="我這週感覺都在瞎忙,什麼都沒做到",
dialog_history="",
previous_module_outputs="我先接住你的心情,接著一起回顧這週。",
pipeline_history="已執行: ['Router'];本模組: 'EmotionSupport';後續: ['Summary']"
)
print(result.emotion_reply)
備註¶
- 請用台灣常見口吻,像朋友/學長姊陪伴。
- 不說教、不下指令、不講大道理。
- 不要再解釋「整個流程」,流程由 Router 說明。
- 只需在合適時順著 pipeline_history 自然提到「等等會一起回顧 / 安排」即可。