使用多訊息對話

Claude 模型入門

Nikhil Rangarajan

Data Scientist

什麼是多訊息對話?

  • 單一提示 vs 對話串

單一提示的聊天

Claude 模型入門

什麼是多訊息對話?

  • 單一提示 vs 對話串
  • 跨多輪建立脈絡
  • Claude 記得先前訊息
  • 更自然、貼近人類的互動

多提示的聊天

Claude 模型入門

為什麼要用多訊息對話?

  • 複雜問題需要反覆修正
  • 脈絡促進理解逐步加深
  • 協作帶來更佳結果

多提示的聊天

Claude 模型入門

跨輪維持脈絡

$$

  • 💬 Claude 會參照先前對話內容
  • 🧠 理解會逐步累積
  • ➡ 先前決策會影響新回應
  • 📨 脈絡讓對話更連貫
Claude 模型入門

何時用多訊息或單一提示

比較單一與多訊息提示的示意圖

$$

  • 單一提示:明確、快速的任務
Claude 模型入門

何時用多訊息或單一提示

比較單一與多訊息提示的示意圖

$$

  • 單一提示:明確、快速的任務
  • 多訊息:複雜問題、探索式對話
Claude 模型入門

對話記憶與限制

  • Claude 會記住整段對話歷史
  • 脈絡視窗有 token 上限
  • 較舊訊息可能被截斷
  • 重要脈絡應放在近期

捲動的羊皮紙與羽毛筆

Claude 模型入門

範例-內容策略

messages = [
    {"role": "user", "content": "I need a content strategy for my tech blog"},
    {"role": "assistant", "content": "I'll help you create a comprehensive 
     content strategy..."},
    {"role": "user", "content": "Great! Now focus on topics that beginners 
     would find helpful"},
    {"role": "assistant", "content": "Perfect! For beginner-friendly content..."},
    {"role": "user", "content": "Can you create a 3-month editorial calendar 
     based on those topics?"}
]
Claude 模型入門

多輪對話的最佳做法

$$

  • 每輪聚焦單一請求
  • 需要時參照先前回應
  • 重大轉題可重開對話
  • 追蹤重要決策與變更

夾板與核對清單

Claude 模型入門

一起來練習吧!

Claude 模型入門

Preparing Video For Download...