Documentation
¶
Overview ¶
Package eval runs agents against a generated question bank and aggregates the results into an analysis suitable for reporting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentAnswer ¶
type AgentAnswer struct {
Agent string `json:"agent"`
Chosen int `json:"chosen"` // option index, -1 if unparsed
Label string `json:"label"`
Confidences map[string]float64 `json:"confidences,omitempty"`
Reasoning string `json:"reasoning,omitempty"`
Correct bool `json:"correct"`
Err string `json:"error,omitempty"`
}
AgentAnswer is a single agent's answer to a single question.
type AgentMetrics ¶
type AgentMetrics struct {
Agent string `json:"agent"`
Total int `json:"total"`
Answered int `json:"answered"`
Correct int `json:"correct"`
Accuracy float64 `json:"accuracy"`
Coverage float64 `json:"coverage"`
MeanConfidence float64 `json:"mean_confidence"`
Brier float64 `json:"brier"`
ECE float64 `json:"ece"`
MacroF1 float64 `json:"macro_f1,omitempty"`
}
type AggregateMetrics ¶
type Analysis ¶
type Analysis struct {
Mode string `json:"mode"`
TotalQuestions int `json:"total_questions"`
Agents []*AgentMetrics `json:"agents"`
PerChapter map[int]*AggregateMetrics `json:"per_chapter,omitempty"`
PerDifficulty map[string]*AggregateMetrics `json:"per_difficulty,omitempty"`
Confusion map[string]map[int]map[int]int `json:"confusion,omitempty"`
Calibration map[string][]Bin `json:"calibration,omitempty"`
Debate *DebateAnalysis `json:"debate,omitempty"`
}
func (*Analysis) ResultsSummary ¶
type DebateAnalysis ¶
type Mode ¶
type Mode string
Mode selects how agents are exercised against each question.
const ( // ModeAnswerOnly asks each agent to answer every question directly. ModeAnswerOnly Mode = "answer_only" // ModeDebate runs a full gaslit debate per question and scores the winner. ModeDebate Mode = "debate" // ModeBoth runs answer-only first, then a debate per question. ModeBoth Mode = "both" )
type QuestionResult ¶
type QuestionResult struct {
Question qa.Question `json:"question"`
Answers map[string]*AgentAnswer `json:"answers,omitempty"`
Debate *core.FullDebateSummary `json:"debate,omitempty"`
DebateWinner int `json:"debate_winner"`
DebateCorrect bool `json:"debate_correct"`
DebateEngaged bool `json:"debate_engaged"`
}
QuestionResult bundles the per-question outcome.
type QuestionResultDetail ¶
type QuestionResultDetail struct {
ID string
Source string
Chapter int
ChapterTitle string
Question string
Options []string
Answer int
AnswerLabel string
AgentAnswers map[string]*AgentAnswer
DebateWinner int
DebateCorrect bool
DebateEngaged bool
}
QuestionResult helpers for detailed reporting (optional)
type RunConfig ¶
type RunConfig struct {
// Mode selects the evaluation mode. Default ModeAnswerOnly.
Mode Mode
// Targets are the agents to test. Required.
Targets []Target
// SupervisorModel powers debate mode. Required for ModeDebate/ModeBoth.
SupervisorModel model.BaseModel[*schema.Message]
// EngineOptions are applied to the gaslit engine used in debate mode.
EngineOptions []core.Option
// Verbose enables engine progress logging in debate mode.
Verbose bool
// Logger receives progress output. Optional.
Logger *slog.Logger
}
RunConfig configures an evaluation run.
type RunResult ¶
type RunResult struct {
Mode Mode `json:"mode"`
Bank *qa.QuestionBank `json:"bank"`
Results []QuestionResult `json:"results"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
}
RunResult is the full outcome of an evaluation run.
func (*RunResult) Details ¶
func (res *RunResult) Details() []QuestionResultDetail
Click to show internal directories.
Click to hide internal directories.