跳到正文
PromptBeat · 模型与 Prompt

报告

渲染 PromptBeat 评测结果,并记录当前后端流程实际写出的 artifact。

promptbeat report 渲染已有的评测结果。它不会运行目标、调用 Judge,也不会重新执行评测后端。

终端窗口
./bin/promptbeat report \
--input artifacts/llm-basic/run/evaluation_result.json \
--output artifacts/llm-basic/run/report.html

使用 --input 指定结果路径。--eval-result 是同一个输入参数的兼容别名。输出扩展名决定 report 命令支持的格式:

终端窗口
./bin/promptbeat report \
--input artifacts/llm-basic/run/evaluation_result.json \
--output artifacts/llm-basic/run/report.json

规范化的 Go 结果是 EvaluationResult,报告渲染器使用其中这些字段:

部分内容
SummaryTotal、Passed、Failed、Review 和 Error 计数。
ItemsScenario、Seed、Risk、目标 Provider、case Prompt、实际输出、状态、原因,以及可选的 Judge 输出或证据。
Findings评测结果中由失败 item 产生的 PromptBeat Finding。

报告只是这个输入的视图。它不会为每个失败 item 凭空创建单独 Finding 文件,也不会自动生成运行对比。

完整的项目运行使用外部评测后端,并在输出目录写入这些默认名称的 artifact:

Artifact作用
promptfoo.redteam.yaml从 PromptBeat 项目编译出的后端配置。
promptfoo.generated.yaml流程包含生成阶段时使用的后端生成配置。
promptfoo-result.json后端原始评测结果。
evaluation_result.jsonPromptBeat 的规范化评测结果。
report.html从规范化结果生成的 HTML 报告。

直接运行 promptbeat eval 会在指定输出目录写入后端结果及 stdout/stderr 日志。它本身不承诺生成规范化的 evaluation_result.json;需要该 artifact 时,使用项目流水线。

  • HTML 是写入 report.html 或其他 .html 路径的浏览器报告。
  • JSON 是写入 report.json 或其他 .json 路径的结构化报告。

两种格式都从给定结果生成。结果可能包含真实 Prompt 和模型响应,因此生成的报告应遵守与评测日志相同的处理策略。