Documentation
¶
Overview ¶
Package judge grades an answer with a second agent (LLM-as-judge) through the OpenAI-compatible /v1/chat/completions endpoint. The Run entry point and the verdict parser live in run.go.
Index ¶
Constants ¶
const DefaultMinScore = 0.7
DefaultMinScore is applied when expect.judge.min_score is unset.
Variables ¶
var UserAgent = "docsgpt-cli-bench"
UserAgent is sent with judge requests; the CLI stamps its version.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaseURL string
APIKey string
Timeout time.Duration
Model string // forwarded as the chat request model; "" = "docsgpt" placeholder (agent default)
Temperature *float64 // forwarded when set (e.g. 0 for deterministic grading)
RunTag string // bench run tag header (see target.BenchTagHeader)
}
Config identifies the judge agent.
type Verdict ¶
Verdict is the judge's parsed grading.
func Run ¶
Run asks the judge agent to grade answer against rubric for the original question and parses a {"score": ..., "reasoning": ...} JSON verdict from its reply, tolerating markdown fences and surrounding prose. The score is clamped to [0,1]. cfg.Timeout, when > 0, bounds the whole request; ctx cancellation is honored throughout.