Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EvalEntry ¶ added in v0.4.0
type EvalEntry struct {
Input EvalInput `json:"input"`
Scope string `json:"scope"`
Expected string `json:"expected"`
Label string `json:"label"`
}
EvalEntry represents a single labeled example in an evaluation dataset.
type EvalInput ¶ added in v0.4.0
EvalInput describes the operation and parameters for an evaluation entry.
type Expectation ¶
type Expectation struct {
Decision string `yaml:"decision"`
Rule string `yaml:"rule,omitempty"`
Message string `yaml:"message,omitempty"`
Mutations []ExpectedMutation `yaml:"mutations,omitempty"`
}
Expectation is the expected evaluation result.
type ExpectedMutation ¶
ExpectedMutation is an expected mutation from a redact action.
type FixtureCall ¶
type FixtureCall struct {
Operation string `yaml:"operation"`
Params map[string]any `yaml:"params"`
Context *FixtureContext `yaml:"context,omitempty"`
}
FixtureCall is the call to evaluate.
type FixtureContext ¶
type FixtureContext struct {
AgentID string `yaml:"agent_id,omitempty"`
UserID string `yaml:"user_id,omitempty"`
Scope string `yaml:"scope,omitempty"`
Direction string `yaml:"direction,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
Timestamp string `yaml:"timestamp,omitempty"` // RFC3339 format
}
FixtureContext is optional context overrides.
type FixtureFile ¶
type FixtureFile struct {
Path string // source file path (set during loading, not in YAML)
Scope string `yaml:"scope"`
Tests []TestCase `yaml:"tests"`
}
FixtureFile is a parsed test fixture file.
func LoadFixtures ¶
func LoadFixtures(path string) ([]FixtureFile, error)
LoadFixtures reads and parses fixture files from a path. Path can be a single .yaml/.yml file or a directory (loads all yaml files).
type FixtureVerdict ¶ added in v0.4.0
FixtureVerdict is a recorded judge verdict for deterministic testing.
type TestCase ¶
type TestCase struct {
Name string `yaml:"name"`
Call FixtureCall `yaml:"call"`
Expect Expectation `yaml:"expect"`
JudgeVerdicts map[string]FixtureVerdict `yaml:"judge_verdicts,omitempty"`
}
TestCase is a single test: a call and the expected result.
Click to show internal directories.
Click to hide internal directories.