eval

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

@sk-task ecosystem#T3.1: Eval package (contains, regex, llm_judge)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contains

type Contains struct {
	Value string
}

Contains checks if the output contains a substring.

func (Contains) Eval

func (c Contains) Eval(output string) Result

Eval implements the Tool interface.

type Criterion

type Criterion interface {
	Eval(output string) Result
}

Criterion defines the interface for eval criteria.

type LLMJudge

type LLMJudge struct {
	Prompt string
	LLM    llm.Client
}

LLMJudge uses an LLM to evaluate output quality.

func (LLMJudge) Eval

func (j LLMJudge) Eval(output string) Result

Eval implements the Criterion interface.

type Regex

type Regex struct {
	Pattern string
	// contains filtered or unexported fields
}

Regex checks if the output matches a regular expression.

func NewRegex

func NewRegex(pattern string) (*Regex, error)

NewRegex creates a new Regex criterion, compiling the pattern.

func (*Regex) Eval

func (r *Regex) Eval(output string) Result

Eval implements the Criterion interface.

type Result

type Result struct {
	Criterion       string
	Value           string
	Passed          bool
	Details         string
	TaskDescription string
}

Result represents the outcome of a single eval criterion evaluation.

func Run

func Run(criteria []Criterion, taskOutputs map[string]string) []Result

Run executes eval criteria against a map of task descriptions to outputs.

Jump to

Keyboard shortcuts

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