Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

adk-eval-guideadk 评估指南

Agent Skill

adk-eval-guide 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

61,776

周安装

2,623

GitHub Stars

1,326

下载量

21,632
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:adk-eval-guide(adk 评估指南)
来源仓库:https://github.com/google/adk-docs
仓库路径:skills/adk-eval-guide
安装命令:
npx skills add https://github.com/google/adk-docs --skill adk-eval-guide
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/google/adk-docs --skill adk-eval-guide

简介

ADK 代理的综合评估方法指南,涵盖指标、架构和迭代工作流程。

  • 提供八个评估标准(工具轨迹、响应匹配、基于量规的评分、幻觉检测、安全性)以及可配置的阈值和判断模型选项
  • 包括具有多回合对话支持的评估集模式文档、工具使用轨迹规范和会话状态初始化模式
  • 概述 eval-fix 循环:从小处开始,运行评估,诊断故障,修复代码或评估集,迭代直到满足阈值
  • 记录常见故障原因(轨迹差距、状态类型不匹配、应用程序名称不匹配、模型思维模式冲突)以及具体的修复步骤
  • 参考四个补充指南,涵盖详细指标、用户模拟、内置工具行为和多模式评估模式

SKILL.md

ADK Evaluation Guide

Scaffolded project? If you used /adk-scaffold, you already have make eval, tests/eval/evalsets/, and tests/eval/eval_config.json. Start with make eval and iterate from there. Non-scaffolded? Use adk eval directly — see Running Evaluations below.

Reference Files

FileContents
references/criteria-guide.mdComplete metrics reference — all 8 criteria, match types, custom metrics, judge model config
references/user-simulation.mdDynamic conversation testing — ConversationScenario, user simulator config, compatible metrics
references/builtin-tools-eval.mdgoogle_search and model-internal tools — trajectory behavior, metric compatibility
references/multimodal-eval.mdMultimodal inputs — evalset schema, built-in metric limitations, custom evaluator pattern

The Eval-Fix Loop

Evaluation is iterative. When a score is below threshold, diagnose the cause, fix it, rerun — don't just report the failure.

How to iterate

  1. Start small: Begin with 1-2 eval cases, not the full suite
  2. Run eval: make eval (or adk eval if no Makefile)
  3. Read the scores — identify what failed and why
  4. Fix the code — adjust prompts, tool logic, instructions, or the evalset
  5. Rerun eval — verify the fix worked
  6. Repeat steps 3-5 until the case passes
  7. Only then add more eval cases and expand coverage

Expect 5-10+ iterations. This is normal — each iteration makes the agent better.

What to fix when scores fail

FailureWhat to change
tool_trajectory_avg_score lowFix agent instructions (tool ordering), update evalset tool_uses, or switch to IN_ORDER/ANY_ORDER match type
response_match_score lowAdjust agent instruction wording, or relax the expected response
final_response_match_v2 lowRefine agent instructions, or adjust expected response — this is semantic, not lexical
rubric_based score lowRefine agent instructions to address the specific rubric that failed
hallucinations_v1 lowTighten agent instructions to stay grounded in tool output
Agent calls wrong toolsFix tool descriptions, agent instructions, or tool_config
Agent calls extra toolsUse IN_ORDER/ANY_ORDER match type, add strict stop instructions, or switch to rubric_based_tool_use_quality_v1

Choosing the Right Criteria

GoalRecommended Metric
Regression testing / CI/CD (fast, deterministic)tool_trajectory_avg_score + response_match_score
Semantic response correctness (flexible phrasing OK)final_response_match_v2
Response quality without reference answerrubric_based_final_response_quality_v1
Validate tool usage reasoningrubric_based_tool_use_quality_v1
Detect hallucinated claimshallucinations_v1
Safety compliancesafety_v1
Dynamic multi-turn conversationsUser simulation + hallucinations_v1 / safety_v1 (see references/user-simulation.md)
Multimodal input (image, audio, file)tool_trajectory_avg_score + custom metric for response quality (see references/multimodal-eval.md)

For the complete metrics reference with config examples, match types, and custom metrics, see references/criteria-guide.md.


Running Evaluations

# Scaffolded projects:
make eval EVALSET=tests/eval/evalsets/my_evalset.json

# Or directly via ADK CLI:
adk eval ./app <path_to_evalset.json> --config_file_path=<path_to_config.json> --print_detailed_results

# Run specific eval cases from a set:
adk eval ./app my_evalset.json:eval_1,eval_2

# With GCS storage:
adk eval ./app my_evalset.json --eval_storage_uri gs://my-bucket/evals

CLI options: --config_file_path, --print_detailed_results, --eval_storage_uri, --log_level

Eval set management:

adk eval_set create <agent_path> <eval_set_id>
adk eval_set add_eval_case <agent_path> <eval_set_id> --scenarios_file <path> --session_input_file <path>

Configuration Schema (eval_config.json)

Both camelCase and snake_case field names are accepted (Pydantic aliases). The examples below use snake_case, matching the official ADK docs.

Full example

{
  "criteria": {
    "tool_trajectory_avg_score": {
      "threshold": 1.0,
      "match_type": "IN_ORDER"
    },
    "final_response_match_v2": {
      "threshold": 0.8,
      "judge_model_options": {
        "judge_model": "gemini-2.5-flash",
        "num_samples": 5
      }
    },
    "rubric_based_final_response_quality_v1": {
      "threshold": 0.8,
      "rubrics": [
        {
          "rubric_id": "professionalism",
          "rubric_content": { "text_property": "The response must be professional and helpful." }
        },
        {
          "rubric_id": "safety",
          "rubric_content": { "text_property": "The agent must NEVER book without asking for confirmation." }
        }
      ]
    }
  }
}

Simple threshold shorthand is also valid: "response_match_score": 0.8

For custom metrics, judge_model_options details, and user_simulator_config, see references/criteria-guide.md.


EvalSet Schema (evalset.json)

{
  "eval_set_id": "my_eval_set",
  "name": "My Eval Set",
  "description": "Tests core capabilities",
  "eval_cases": [
    {
      "eval_id": "search_test",
      "conversation": [
        {
          "invocation_id": "inv_1",
          "user_content": { "parts": [{ "text": "Find a flight to NYC" }] },
          "final_response": {
            "role": "model",
            "parts": [{ "text": "I found a flight for $500. Want to book?" }]
          },
          "intermediate_data": {
            "tool_uses": [
              { "name": "search_flights", "args": { "destination": "NYC" } }
            ],
            "intermediate_responses": [
              ["sub_agent_name", [{ "text": "Found 3 flights to NYC." }]]
            ]
          }
        }
      ],
      "session_input": { "app_name": "my_app", "user_id": "user_1", "state": {} }
    }
  ]
}

Key fields:

  • intermediate_data.tool_uses — expected tool call trajectory (chronological order)
  • intermediate_data.intermediate_responses — expected sub-agent responses (for multi-agent systems)
  • session_input.state — initial session state (overrides Python-level initialization)
  • conversation_scenario — alternative to conversation for user simulation (see references/user-simulation.md)

Common Gotchas

The Proactivity Trajectory Gap

LLMs often perform extra actions not asked for (e.g., google_search after save_preferences). This causes tool_trajectory_avg_score failures with EXACT match. Solutions:

  1. Use IN_ORDER or ANY_ORDER match type — tolerates extra tool calls between expected ones
  2. Include ALL tools the agent might call in your expected trajectory
  3. Use rubric_based_tool_use_quality_v1 instead of trajectory matching
  4. Add strict stop instructions: "Stop after calling save_preferences. Do NOT search."

Multi-turn conversations require tool_uses for ALL turns

The tool_trajectory_avg_score evaluates each invocation. If you don't specify expected tool calls for intermediate turns, the evaluation will fail even if the agent called the right tools.

{
  "conversation": [
    {
      "invocation_id": "inv_1",
      "user_content": { "parts": [{"text": "Find me a flight from NYC to London"}] },
      "intermediate_data": {
        "tool_uses": [
          { "name": "search_flights", "args": {"origin": "NYC", "destination": "LON"} }
        ]
      }
    },
    {
      "invocation_id": "inv_2",
      "user_content": { "parts": [{"text": "Book the first option"}] },
      "final_response": { "role": "model", "parts": [{"text": "Booking confirmed!"}] },
      "intermediate_data": {
        "tool_uses": [
          { "name": "book_flight", "args": {"flight_id": "1"} }
        ]
      }
    }
  ]
}

App name must match directory name

The App object's name parameter MUST match the directory containing your agent:

# CORRECT - matches the "app" directory
app = App(root_agent=root_agent, name="app")

# WRONG - causes "Session not found" errors
app = App(root_agent=root_agent, name="flight_booking_assistant")

The before_agent_callback Pattern (State Initialization)

Always use a callback to initialize session state variables used in your instruction template. This prevents KeyError crashes on the first turn:

async def initialize_state(callback_context: CallbackContext) -> None:
    state = callback_context.state
    if "user_preferences" not in state:
        state["user_preferences"] = {}

root_agent = Agent(
    name="my_agent",
    before_agent_callback=initialize_state,
    instruction="Based on preferences: {user_preferences}...",
)

Eval-State Overrides (Type Mismatch Danger)

Be careful with session_input.state in your evalset. It overrides Python-level initialization:

// WRONG — initializes feedback_history as a string, breaks .append()
"state": { "feedback_history": "" }

// CORRECT — matches the Python type (list)
"state": { "feedback_history": [] }

// NOTE: Remove these // comments before using — JSON does not support comments.

Model thinking mode may bypass tools

Models with "thinking" enabled may skip tool calls. Use tool_config with mode="ANY" to force tool usage, or switch to a non-thinking model for predictable tool calling.


Common Eval Failure Causes

SymptomCauseFix
Missing tool_uses in intermediate turnsTrajectory expects match per invocationAdd expected tool calls to all turns
Agent mentions data not in tool outputHallucinationTighten agent instructions; add hallucinations_v1 metric
"Session not found" errorApp name mismatchEnsure App name matches directory name
Score fluctuates between runsNon-deterministic modelSet temperature=0 or use rubric-based eval
tool_trajectory_avg_score always 0Agent uses google_search (model-internal)Remove trajectory metric; see references/builtin-tools-eval.md
Trajectory fails but tools are correctExtra tools calledSwitch to IN_ORDER/ANY_ORDER match type
LLM judge ignores image/audio in evalget_text_from_content() skips non-text partsUse custom metric with vision-capable judge (see references/multimodal-eval.md)

Deep Dive: ADK Docs

For the official evaluation documentation, fetch these pages:

  • Evaluation overview: https://adk.dev/evaluate/index.md
  • Criteria reference: https://adk.dev/evaluate/criteria/index.md
  • User simulation: https://adk.dev/evaluate/user-sim/index.md

Debugging Example

User says: "tool_trajectory_avg_score is 0, what's wrong?"

  1. Check if agent uses google_search — if so, see references/builtin-tools-eval.md
  2. Check if using EXACT match and agent calls extra tools — try IN_ORDER
  3. Compare expected tool_uses in evalset with actual agent behavior
  4. Fix mismatch (update evalset or agent instructions)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.88%
按下载量换算7,978

Claude

29.66%
按下载量换算6,416

Cursor

17.73%
按下载量换算3,835

Gemini CLI

8.75%
按下载量换算1,893

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills