CMDCEval.Case (cmdc_eval v0.1.0)

Copy Markdown View Source

单个评测用例 struct。

Suite 实现的 cases/0 返回 [Case.t()] 列表,Runner 按 case 并发跑。

字段

  • :id —— case 唯一标识(在 Suite 内 unique)
  • :input —— 用户 prompt 字符串
  • :expected —— 期望结果 spec(map / 字符串 / 函数),由 Suite 的 assert/2 解释
  • :tools —— 该 case 启用的工具模块列表(覆盖 Suite 默认)
  • :metadata —— 附加 metadata(如 :category, :difficulty
  • :timeout_ms —— 单 case 超时(nil 表示用 Runner 默认)

Summary

Functions

构造一个 Case struct(基础校验 + 默认值)。

Types

t()

@type t() :: %CMDCEval.Case{
  expected: term(),
  id: String.t(),
  input: String.t(),
  metadata: map(),
  timeout_ms: pos_integer() | nil,
  tools: [module()] | nil
}

Functions

new(opts)

@spec new(keyword()) :: t()

构造一个 Case struct(基础校验 + 默认值)。

示例

Case.new(id: "sum_basic", input: "1 + 1 = ?", expected: ~r/2/)