跳转到主要内容
使用 agentcompass.run_evaluation(...) 可以把 AgentCompass 嵌入到 Python workflow 中。
from agentcompass import run_evaluation

result = run_evaluation(
    benchmark="swebench_verified",
    harness="mini_swe_agent",
    model="glm-5.2",
    environment="docker",
    benchmark_params={"sample_ids": ["astropy__astropy-12907"]},
    model_base_url="http://localhost:8000/v1",
    model_api_key="EMPTY",
    model_api_protocol="openai-chat",
    model_params={"temperature": 0},
    task_concurrency=1,
    results_dir="results",
    data_dir="data",
    progress="auto",
    log_level="INFO",
)
返回值包含聚合指标、输出路径和执行元数据。Per-task details 会写入 run directory,避免大型评测把所有 artifact 都留在内存中。
参数含义
benchmark已注册 benchmark id。
harness已注册 harness id。
model模型 id,也用于结果路径。
environmentenvironment provider id。
benchmark_paramsbenchmark 参数。
harness_paramsharness-specific 参数。
environment_paramsprovider-specific 参数。
model_*模型 endpoint、协议和凭据。
task_concurrency单次 run 内最大任务并发。
recipe_dirs当前 run 使用的受信任外部 recipe package 目录。