進階 Tester 與 Tool-Step Standards
只有在發布決策取決於 Agent 如何使用 tool,而不只是最終答案時,才使用這份指南。
請先完成一般的驗證與改進流程。當 reviewer 必須檢查指定 tool、argument 或 result 時,再進入這一層。
設定自訂 Tester
在 Tester 管理中,替 Tester 設定聚焦用途、選擇 evaluation model,並撰寫 system prompt。Prompt 可以使用 {input}、{output}、{tool_steps}、{expected_output} 與 {rubric}。
只有 tool behavior 屬於判斷標準時才加入 {tool_steps}。既有 Tester 的 prompt 沒有使用這個 placeholder,就不會取得 tool steps。
當失誤和工具使用有關時,檢查 tool steps
有些失誤不只是最後文字寫得好不好。Agent 可能查錯知識來源、用了太泛的查詢、跳過必要工具,或沒有使用查回來的結果。
在 case detail 頁面中,AI 回覆上方會有 Tool Steps。展開其中一個 step,可以檢查:
- 呼叫了哪個工具
- 送出了哪些 arguments
- 工具回傳了什麼 result
判斷問題時,可以用這些 evidence 決定修正應該放在 Instructions、tool 的 When to Use,還是底層的 Knowledge Base。
如果你建立的 evaluator 需要評估工具使用行為,請在 evaluator system prompt 裡加入 {tool_steps}。現有 evaluator 不會自動使用 tool steps,除非 prompt 明確包含這個 placeholder。
請在 standard 裡使用 canonical tool type,這樣 evaluator 才能穩定對上 tool step。
| 英文名稱 | 中文名稱 | Canonical tool type |
|---|---|---|
| Search Knowledge Base | 搜尋知識庫 | consultant_retrieve_context_objs |
| List Knowledge Base Files | 列出知識庫檔案 | consultant_list_kb_files |
| Read Knowledge Base File Lines | 讀取知識庫檔案行數 | consultant_get_context_obj_lines |
| Search Web | 搜尋網頁 | consultant_search_web |
| Fetch Web Page Content | 讀取網頁內容 | consultant_fetch_web_content |
| Call Agent | 呼叫其他 Agent | consultant_call_agent |
| Request Form | 要求填寫表單 | consultant_request_form |
| Payment | 建立付款 | consultant_payment |
| Memory | 記住使用者資訊 | consultant_memory |
| HTTP Request | 呼叫 HTTP API | consultant_http_request |
| Generate Image | 產生圖片 | consultant_generate_image |
搜尋 Knowledge Base 的 standard 範例:
Required tool:
- Search Knowledge Base (`consultant_retrieve_context_objs`)
Parameter requirements:
- The question should ask about refund policy, refund conditions, or 退費政策.
- The keywords should include refund-related terms.
Result requirements:
- The result should contain refund-related policy information.
Final answer requirements:
- The response should be grounded in the retrieved policy result.
尋找並讀取特定 Knowledge Base 檔案的 standard 範例:
Required tools:
- List Knowledge Base Files (`consultant_list_kb_files`)
- Read Knowledge Base File Lines (`consultant_get_context_obj_lines`)
Parameter requirements:
- `list_kb_files.pattern` should target the expected file name or path.
- `get_context_obj_lines.knowledge_node_id` should come from the file list result.
- The requested line range should be narrow enough to inspect the relevant section.
Result requirements:
- The file result should contain the policy, procedure, or source section needed to answer.
Final answer requirements:
- The response should use the file content, not only general knowledge.
網頁研究的 standard 範例:
Required tools:
- Search Web (`consultant_search_web`)
- Fetch Web Page Content (`consultant_fetch_web_content`) when a search result must be opened before answering
Parameter requirements:
- The search question and keywords should match the user's requested topic.
- The fetched URL should come from a relevant search result.
Result requirements:
- The fetched content should contain evidence for the final answer.
Final answer requirements:
- The response should not claim facts that are missing from the fetched content.
轉交其他 Agent 的 standard 範例:
Required tool:
- Call Agent (`consultant_call_agent`)
Parameter requirements:
- `agent_name` should match the specialist agent responsible for the request.
- `query` should include the user's key need and enough context for the specialist agent.
Final answer requirements:
- The response should use the specialist agent's result or clearly explain the handoff outcome.
發布前檢查
- Tester 的 prompt 有包含它實際需要的 placeholders。
- Standard 使用 canonical tool type,而不是只靠畫面顯示名稱。
- 先人工檢查少量結果,確認 judge 對 pass/fail 的解讀符合 reviewer。
- Judge model 或 prompt 改變後,重跑代表性 cases。