{
 "Tool Calling 的運作原理#1": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "nodes": [
   {
    "label": "送出訊息與工具清單",
    "color": 0
   },
   {
    "label": "模型回傳要呼叫的工具",
    "color": 1
   },
   {
    "label": "程式驗證並執行",
    "color": 2
   },
   {
    "label": "tool 訊息送回",
    "sub": "帶呼叫編號",
    "color": 3
   },
   {
    "label": "重複至最終回答",
    "color": 4,
    "kind": "end"
   }
  ]
 },
 "Tool Calling 的運作原理#2": {
  "type": "table",
  "head": [
   "常見錯誤",
   "正確做法"
  ],
  "rows": [
   [
    "參數當成字典",
    "先用 json.loads 解析"
   ],
   [
    "漏放要求呼叫的訊息",
    "原樣加進訊息串列"
   ],
   [
    "tool 訊息缺呼叫編號",
    "帶上對應的編號"
   ],
   [
    "工具描述太含糊",
    "寫清楚何時使用"
   ],
   [
    "沒有限制迴圈次數",
    "設定最大回合數"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ]
 },
 "Tool Calling 的運作原理#4": {
  "type": "cards",
  "reveal": [
   0,
   1,
   1,
   2
  ],
  "cards": [
   {
    "title": "請求:tools 清單",
    "points": [
     "名稱 name",
     "描述 description",
     "參數 JSON Schema"
    ]
   },
   {
    "title": "回應:tool_calls",
    "points": [
     "內容 content 為空",
     "呼叫編號 id",
     "函式名稱與參數"
    ]
   }
  ]
 },
 "Tool Calling 的運作原理#5": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   3
  ],
  "nodes": [
   {
    "label": "tool 訊息",
    "sub": "帶呼叫編號",
    "color": 0
   },
   {
    "label": "再呼叫一次模型",
    "color": 1
   },
   {
    "label": "自然語言答案",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "安全執行系統指令#1": {
  "type": "table",
  "head": [
   "底線",
   "重點"
  ],
  "rows": [
   [
    "1 白名單",
    "只有登錄的工具與執行檔"
   ],
   [
    "2 不用 shell=True",
    "不讓模型給整串指令"
   ],
   [
    "3 陣列傳參數",
    "不經過 shell 解析"
   ],
   [
    "4 輸入驗證",
    "Schema:列舉、樣式、範圍"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ]
 },
 "安全執行系統指令#2": {
  "type": "table",
  "head": [
   "底線",
   "重點"
  ],
  "rows": [
   [
    "5 唯讀優先",
    "變更類工具需人工確認"
   ],
   [
    "6 逾時與輸出限制",
    "每個指令有 timeout、截斷輸出"
   ],
   [
    "7 審計紀錄",
    "誰、何時、工具、參數、狀態"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "安全執行系統指令#3": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "8 最小權限",
    "points": [
     "專用低權限帳號",
     "sudoers 精準授權單一指令"
    ]
   },
   {
    "title": "對策一:樣式驗證",
    "points": [
     "只允許英數與少數符號",
     "不可用減號開頭"
    ]
   },
   {
    "title": "對策二:列舉值",
    "points": [
     "能用列舉就用列舉"
    ]
   },
   {
    "title": "對策三:兩個減號",
    "points": [
     "隔開選項與位置參數"
    ]
   }
  ]
 },
 "安全執行系統指令#4": {
  "type": "table",
  "head": [
   "常見錯誤",
   "問題"
  ],
  "rows": [
   [
    "引號跳脫加 shell",
    "漏一處就破功"
   ],
   [
    "混用多種執行方式",
    "與 shell 模式混用"
   ],
   [
    "沒設環境變數",
    "子程序繼承 API 金鑰"
   ],
   [
    "回傳全部錯誤輸出",
    "可能洩漏路徑與設定"
   ]
  ],
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ]
 },
 "安全執行系統指令#7": {
  "type": "table",
  "head": [
   "名稱",
   "絕對路徑"
  ],
  "rows": [
   [
    "uptime",
    "/usr/bin/uptime"
   ],
   [
    "df",
    "/usr/bin/df"
   ],
   [
    "systemctl",
    "/usr/bin/systemctl"
   ],
   [
    "journalctl",
    "/usr/bin/journalctl"
   ]
  ],
  "reveal": [
   0,
   0,
   4,
   4
  ]
 },
 "建立工具註冊機制#1": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   3,
   3
  ],
  "cards": [
   {
    "title": "工具清單",
    "points": [
     "產生要送給模型的工具描述"
    ]
   },
   {
    "title": "白名單",
    "points": [
     "不在註冊表的名稱一律拒絕"
    ]
   },
   {
    "title": "執行閘門",
    "points": [
     "JSON 解析、參數驗證",
     "人工確認、輸出截斷、審計"
    ]
   }
  ]
 },
 "建立工具註冊機制#4": {
  "type": "bar",
  "labels": [
   "工具結果",
   "錯誤輸出"
  ],
  "values": [
   8000,
   2000
  ],
  "unit": "字元",
  "reveal": [
   0,
   1,
   1,
   2
  ]
 },
 "建立工具註冊機制#7": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   0,
   5,
   5
  ],
  "nodes": [
   {
    "label": "是否為物件",
    "color": 0
   },
   {
    "label": "有無多餘參數",
    "color": 1
   },
   {
    "label": "必要參數齊全",
    "color": 2
   },
   {
    "label": "型別正確",
    "color": 3
   },
   {
    "label": "列舉/範圍/樣式",
    "color": 4,
    "kind": "end"
   }
  ]
 },
 "對話迴圈、確認與審計#2": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   0,
   7,
   7,
   7
  ],
  "nodes": [
   {
    "label": "查註冊表",
    "color": 0
   },
   {
    "label": "解析參數",
    "color": 1
   },
   {
    "label": "驗證參數",
    "color": 2
   },
   {
    "label": "人工確認",
    "sub": "需確認才執行",
    "color": 3
   },
   {
    "label": "執行工具",
    "color": 4
   },
   {
    "label": "截斷輸出",
    "color": 0
   },
   {
    "label": "寫審計紀錄",
    "color": 1,
    "kind": "end"
   }
  ]
 },
 "對話迴圈、確認與審計#5": {
  "type": "flow",
  "layout": "cycle",
  "reveal": [
   0,
   5,
   5,
   5
  ],
  "nodes": [
   {
    "label": "呼叫模型",
    "sub": "最多 5 回合",
    "color": 0
   },
   {
    "label": "要求工具?",
    "color": 1
   },
   {
    "label": "放回模型訊息",
    "color": 2
   },
   {
    "label": "執行工具",
    "color": 3
   },
   {
    "label": "結果加入訊息",
    "color": 4,
    "kind": "end"
   }
  ]
 }
}