CMDCEval.Run (cmdc_eval v0.1.0)

Copy Markdown View Source

单个 case 的运行结果。

Runner 跑完每个 case 后产出一个 %Run{},最终聚合到 %Report{}

字段

  • :suite —— Suite 名(atom 或 string)
  • :case_id —— Case.id
  • :model —— 评测使用的 model 字符串
  • :pass —— 通过 boolean(Suite 的 assert/2 返回值)
  • :latency_ms —— Agent 端到端响应时长
  • :tokens_in —— prompt tokens
  • :tokens_out —— completion tokens
  • :cost_usd —— 估算成本(USD)
  • :events_digest —— 事件摘要 sha256(debug / 重放用)
  • :error —— 失败原因(nil 表示成功)
  • :timestamp —— ISO8601 UTC 时间戳
  • :metadata —— 用户附加数据

Summary

Functions

为失败的 case 构造 Run(pass: false + error reason)。

为成功的 case 构造 Run(pass: true)。

Types

t()

@type t() :: %CMDCEval.Run{
  case_id: String.t(),
  cost_usd: float(),
  error: term() | nil,
  events_digest: String.t() | nil,
  latency_ms: non_neg_integer(),
  metadata: map(),
  model: String.t(),
  pass: boolean(),
  suite: String.t() | atom(),
  timestamp: String.t(),
  tokens_in: non_neg_integer(),
  tokens_out: non_neg_integer()
}

Functions

failure(opts, reason)

@spec failure(
  keyword(),
  term()
) :: t()

为失败的 case 构造 Run(pass: false + error reason)。

success(opts)

@spec success(keyword()) :: t()

为成功的 case 构造 Run(pass: true)。