Agent 工程

一次對話背後的 5 條訊息

左邊:使用者看到的介面 | 右邊:API 裡真正發生的。向下滾動,自動演示一次查天氣背後發生了什麼。

實際執行過程
訊息 0
Token 0
API 0
共 7 步 · 看一次查天氣背後發生了什麼
JSON 格式參考
messages 陣列的完整格式
{ "messages": [ { "role": "system", "content": "指令" }, { "role": "user", "content": "使用者的話" }, { "role": "assistant", "content": null, "tool_calls": [{ "name": "…", "arguments": {…} }] }, { "role": "tool", "tool_call_id": "…", "content": "結果" }, { "role": "assistant", "content": "最終回答" } ] } // 共 5 條訊息 // 2 次模型呼叫 // 1 次工具呼叫
Takeaway
Takeaway 使用者看到的是一句回答,API 裡跑了 5 條訊息、2 次模型呼叫、1 次外部 API。產品設計的本質就是:決定這些環節中,哪些讓使用者感知、哪些靜默處理。