judge

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package judge evaluates arbitrary subjects with a structured-output chat model. Subject validation and prompt construction remain owned by callers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config[T any] struct {
	Model   chat.Model
	Metric  eval.Metric
	Prompt  Prompt[T]
	Options chat.Options
	// Threshold is optional. Without one, evaluation produces a score without
	// inventing a pass/fail decision.
	Threshold *eval.Score
	Samples   int
}

type Evaluator

type Evaluator[T any] struct {
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator[T any](config Config[T]) (*Evaluator[T], error)

func (*Evaluator[T]) Evaluate

func (e *Evaluator[T]) Evaluate(ctx context.Context, subject T) (eval.Report, error)

type Prompt

type Prompt[T any] func(T) (chat.Message, error)

Jump to

Keyboard shortcuts

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