Versions in this module Expand all Collapse all v0 v0.1.1 Jun 26, 2026 v0.1.0 Jun 26, 2026 Changes in this version + func Assertion(passed bool) single + func Category(label string) single + func IncrementMetric(ctx context.Context, name string, amount float64) + func Score(value float64) single + func ScoreInt(value int) single + func SetAttribute(ctx context.Context, name string, value any) + type BaseLifecycle struct + func (BaseLifecycle[I, O, M]) PrepareContext(_ context.Context, ec *EvaluatorContext[I, O, M]) (*EvaluatorContext[I, O, M], error) + func (BaseLifecycle[I, O, M]) Setup(context.Context) error + func (BaseLifecycle[I, O, M]) Teardown(context.Context, *ReportCase[I, O, M], *ReportCaseFailure[I, O, M]) error + type Bool bool + func (b Bool) String() string + type Case struct + Evaluators []Evaluator[I, O, M] + ExpectedOutput O + HasExpectedOutput bool + HasMetadata bool + Inputs I + Metadata M + Name string + func NewCase[I, O, M any](inputs I, opts ...CaseOption[I, O, M]) Case[I, O, M] + type CaseBuilder struct + func (b *CaseBuilder[I, O, M]) Build() Case[I, O, M] + func (b *CaseBuilder[I, O, M]) Eval(evaluators ...Evaluator[I, O, M]) *CaseBuilder[I, O, M] + func (b *CaseBuilder[I, O, M]) Expect(expected O) *CaseBuilder[I, O, M] + func (b *CaseBuilder[I, O, M]) Meta(metadata M) *CaseBuilder[I, O, M] + func (b *CaseBuilder[I, O, M]) Name(name string) *CaseBuilder[I, O, M] + type CaseOption func(*Case[I, O, M]) + func WithCaseEvaluators[I, O, M any](evaluators ...Evaluator[I, O, M]) CaseOption[I, O, M] + func WithCaseName[I, O, M any](name string) CaseOption[I, O, M] + func WithExpectedOutput[I, O, M any](expected O) CaseOption[I, O, M] + func WithMetadata[I, O, M any](metadata M) CaseOption[I, O, M] + type Config struct + MaxConcurrency int + Metadata map[string]any + Name string + Repeat int + TaskName string + type Contains struct + AsStrings bool + CaseSensitive bool + Name string + Value any + func (c Contains[I, O, M]) Evaluate(_ context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + func (c Contains[I, O, M]) EvaluationName() string + func (c Contains[I, O, M]) Spec() EvaluatorSpec + type Dataset struct + Cases []Case[I, O, M] + Evaluators []Evaluator[I, O, M] + Name string + func LoadDataset[I, O, M any](data []byte, reg *Registry[I, O, M], opts LoadOptions[I, O, M]) (*Dataset[I, O, M], error) + func NewDataset[I, O, M any](name string, cases []Case[I, O, M], evaluators ...Evaluator[I, O, M]) (*Dataset[I, O, M], error) + func (d *Dataset[I, O, M]) AddCase(c Case[I, O, M]) error + func (d *Dataset[I, O, M]) AddEvaluator(e Evaluator[I, O, M]) + func (d *Dataset[I, O, M]) AddEvaluatorForCase(caseName string, e Evaluator[I, O, M]) error + func (d *Dataset[I, O, M]) Evaluate(ctx context.Context, task TaskFunc[I, O], cfg ...Config) (*EvaluationReport[I, O, M], error) + func (d *Dataset[I, O, M]) EvaluateWithLifecycle(ctx context.Context, task TaskFunc[I, O], ...) (*EvaluationReport[I, O, M], error) + func (d *Dataset[I, O, M]) Save(opts SaveOptions) ([]byte, error) + func (d *Dataset[I, O, M]) With(evaluators ...Evaluator[I, O, M]) *Dataset[I, O, M] + type Equals struct + Name string + Value O + func (e Equals[I, O, M]) Evaluate(_ context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + func (e Equals[I, O, M]) EvaluationName() string + func (e Equals[I, O, M]) Spec() EvaluatorSpec + type EqualsExpected struct + Name string + func (e EqualsExpected[I, O, M]) Evaluate(_ context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + func (e EqualsExpected[I, O, M]) EvaluationName() string + func (e EqualsExpected[I, O, M]) Spec() EvaluatorSpec + type EvaluationReason struct + Reason string + Value Scalar + type EvaluationReport struct + Cases []ReportCase[I, O, M] + ExperimentMetadata map[string]any + Failures []ReportCaseFailure[I, O, M] + Name string + func (r *EvaluationReport[I, O, M]) Averages() *ReportCaseAggregate + func (r *EvaluationReport[I, O, M]) CaseGroups() []ReportCaseGroup[I, O, M] + func (r *EvaluationReport[I, O, M]) Fprint(w io.Writer, opts ...RenderOptions) + func (r *EvaluationReport[I, O, M]) Print(opts ...RenderOptions) + func (r *EvaluationReport[I, O, M]) Render(opts ...RenderOptions) string + type EvaluationResult struct + EvaluatorVersion string + Name string + Reason string + Source EvaluatorSpec + Value Scalar + type Evaluator interface + Evaluate func(ctx context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + type EvaluatorContext struct + Attributes map[string]any + Duration time.Duration + ExpectedOutput O + HasExpectedOutput bool + HasMetadata bool + Inputs I + Metadata M + Metrics map[string]float64 + Name string + Output O + type EvaluatorFactory func(spec EvaluatorSpec) (Evaluator[I, O, M], error) + type EvaluatorFailure struct + ErrorMessage string + ErrorType string + EvaluatorVersion string + Name string + Source EvaluatorSpec + type EvaluatorSpec struct + Args []any + Kwargs map[string]any + Name string + func NewSpec(name string) EvaluatorSpec + func NewSpecArg(name string, arg any) EvaluatorSpec + func NewSpecKwargs(name string, kwargs map[string]any) EvaluatorSpec + type Float float64 + func (f Float) String() string + type Int int + func (i Int) String() string + type IsInstance struct + Name string + TypeName string + func (e IsInstance[I, O, M]) Evaluate(_ context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + func (e IsInstance[I, O, M]) EvaluationName() string + func (e IsInstance[I, O, M]) Spec() EvaluatorSpec + type Label string + func (l Label) String() string + type Lifecycle interface + PrepareContext func(ctx context.Context, ec *EvaluatorContext[I, O, M]) (*EvaluatorContext[I, O, M], error) + Setup func(ctx context.Context) error + Teardown func(ctx context.Context, result *ReportCase[I, O, M], ...) error + type LoadOptions struct + DecodeInputs func(any) (I, error) + DecodeMetadata func(any) (M, error) + DecodeOutput func(any) (O, error) + DefaultName string + Format string + type MaxDuration struct + Max time.Duration + func (e MaxDuration[I, O, M]) Evaluate(_ context.Context, ec *EvaluatorContext[I, O, M]) (Output, error) + func (e MaxDuration[I, O, M]) Spec() EvaluatorSpec + type NamedEvaluator interface + EvaluationName func() string + type Output interface + func Named(pairs ...any) Output + func NoResult() Output + type Registry struct + func NewRegistry[I, O, M any]() *Registry[I, O, M] + func (r *Registry[I, O, M]) Register(name string, factory EvaluatorFactory[I, O, M]) + func (r *Registry[I, O, M]) RegisterDefaults() + type RenderOptions struct + IncludeAverages bool + IncludeDurations bool + IncludeExpectedOutput bool + IncludeInput bool + IncludeMetadata bool + IncludeOutput bool + IncludeReasons bool + IncludeTotalDuration bool + OmitTitle bool + Title string + func DefaultRenderOptions() RenderOptions + type ReportCase struct + Assertions map[string]EvaluationResult + Attributes map[string]any + EvaluatorFailures []EvaluatorFailure + ExpectedOutput O + HasExpectedOutput bool + HasMetadata bool + Inputs I + Labels map[string]EvaluationResult + Metadata M + Metrics map[string]float64 + Name string + Output O + Scores map[string]EvaluationResult + SourceCaseName string + TaskDuration time.Duration + TotalDuration time.Duration + type ReportCaseAggregate struct + Assertions *float64 + Labels map[string]map[string]float64 + Metrics map[string]float64 + Name string + Scores map[string]float64 + TaskDuration time.Duration + TotalDuration time.Duration + type ReportCaseFailure struct + ErrorMessage string + ErrorType string + ExpectedOutput O + HasExpectedOutput bool + HasMetadata bool + Inputs I + Metadata M + Name string + SourceCaseName string + type ReportCaseGroup struct + ExpectedOutput O + Failures []ReportCaseFailure[I, O, M] + HasExpectedOutput bool + HasMetadata bool + Inputs I + Metadata M + Name string + Runs []ReportCase[I, O, M] + Summary ReportCaseAggregate + type SaveOptions struct + Format string + Schema string + type Scalar interface + String func() string + type SpecEvaluator interface + Spec func() EvaluatorSpec + type Suite struct + func For[I, O, M any]() Suite[I, O, M] + func (Suite[I, O, M]) Case(inputs I) *CaseBuilder[I, O, M] + func (Suite[I, O, M]) Contains(value any) Contains[I, O, M] + func (Suite[I, O, M]) Dataset(name string, cases ...*CaseBuilder[I, O, M]) *Dataset[I, O, M] + func (Suite[I, O, M]) Equals(value O) Equals[I, O, M] + func (Suite[I, O, M]) EqualsExpected() EqualsExpected[I, O, M] + func (Suite[I, O, M]) IsInstance(typeName string) IsInstance[I, O, M] + func (Suite[I, O, M]) MaxDuration(max time.Duration) MaxDuration[I, O, M] + type TaskFunc func(ctx context.Context, inputs I) (O, error) + type VersionedEvaluator interface + EvaluatorVersion func() string