report

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package report generates human-readable and machine-readable reports from evaluation runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIReporter

type CIReporter struct{}

CIReporter outputs GitHub Actions workflow annotations.

func NewCIReporter

func NewCIReporter() *CIReporter

NewCIReporter creates a new CI reporter.

func (*CIReporter) Format

func (r *CIReporter) Format() Format

func (*CIReporter) Render

func (r *CIReporter) Render(w io.Writer, rpt *Report) error

type Format

type Format string

Format identifies a report output format.

const (
	FormatTerminal Format = "terminal"
	FormatJSON     Format = "json"
	FormatHTML     Format = "html"
	FormatCI       Format = "ci"
)

type HTMLReporter

type HTMLReporter struct{}

HTMLReporter renders a report as an HTML page.

func NewHTMLReporter

func NewHTMLReporter() *HTMLReporter

NewHTMLReporter creates a new HTML reporter.

func (*HTMLReporter) Format

func (r *HTMLReporter) Format() Format

func (*HTMLReporter) Render

func (r *HTMLReporter) Render(w io.Writer, rpt *Report) error

type JSONReporter

type JSONReporter struct{}

JSONReporter renders a report as formatted JSON.

func NewJSONReporter

func NewJSONReporter() *JSONReporter

NewJSONReporter creates a new JSON reporter.

func (*JSONReporter) Format

func (r *JSONReporter) Format() Format

func (*JSONReporter) Render

func (r *JSONReporter) Render(w io.Writer, rpt *Report) error

type Report

type Report struct {
	Run             *evalrun.Run         `json:"run"`
	Results         []*evalrun.Result    `json:"results"`
	Stats           *evalrun.ResultStats `json:"stats"`
	DimensionScores map[string]float64   `json:"dimension_scores,omitempty"`
	GeneratedAt     time.Time            `json:"generated_at"`
}

Report holds all data needed to render an evaluation report.

func NewReport

func NewReport(run *evalrun.Run, results []*evalrun.Result, stats *evalrun.ResultStats) *Report

NewReport creates a report from run data.

type Reporter

type Reporter interface {
	Format() Format
	Render(w io.Writer, report *Report) error
}

Reporter generates a report in a specific format.

type TerminalReporter

type TerminalReporter struct{}

TerminalReporter renders a colored table report to the terminal.

func NewTerminalReporter

func NewTerminalReporter() *TerminalReporter

NewTerminalReporter creates a new terminal reporter.

func (*TerminalReporter) Format

func (r *TerminalReporter) Format() Format

func (*TerminalReporter) Render

func (r *TerminalReporter) Render(w io.Writer, rpt *Report) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL