Versions in this module Expand all Collapse all v0 v0.45.0 Jun 23, 2026 Changes in this version + const DefaultEncoding + const ModeBaseline + const ModeCodeExecution + const ModeRetrieveTools + func AveragePrecision(ranked []string, labels []Label) float64 + func NDCGAtK(ranked []string, labels []Label, k int) float64 + func RecallAtK(ranked []string, labels []Label, k int) float64 + func ReciprocalRank(ranked []string, labels []Label) float64 + type Corpus struct + Tools []Tool + Version string + func LoadCorpus(path string) (*Corpus, error) + type GoldenQuery struct + ID string + Labels []Label + Query string + type GoldenSet struct + CorpusVersion string + Queries []GoldenQuery + func LoadGoldenSet(path string) (*GoldenSet, error) + type Label struct + Relevance int + ToolID string + type LatencyReport struct + LoadAllToolsMs float64 + MaxMs float64 + P50ms float64 + P95ms float64 + P99ms float64 + Samples int + type LiveClient struct + APIKey string + BaseURL string + HTTP *http.Client + func NewLiveClient(baseURL, apiKey string) *LiveClient + func (c *LiveClient) FetchUpstreamTools(ctx context.Context) ([]Tool, error) + func (c *LiveClient) Search(ctx context.Context, query string, limit int) (ranked []string, latency time.Duration, err error) + type LiveModeResult struct + ContextTools int + Mode string + SavingsRatio float64 + Tokens int + type LiveReport struct + Encoding string + Latency *LatencyReport + Proxy string + Retrieval *RetrievalMetrics + Tokens *LiveTokenReport + func RunLive(ctx context.Context, client *LiveClient, golden *GoldenSet) (*LiveReport, error) + func (r *LiveReport) WriteJSON(dir string) (string, error) + type LiveTokenReport struct + AuthoritativeHeadline bool + BaselineSchemasCounted bool + BaselineTokens int + Encoding string + Modes []LiveModeResult + Notes []string + ProxySchemasCounted bool + UpstreamTools int + type ModeResult struct + ContextTools int + Mode string + SavingsRatio float64 + Tokens int + type Report struct + CorpusTools int + CorpusVersion string + Encoding string + Modes []ModeResult + Notes []string + func ComputeReport(tk *Tokenizer, corpus *Corpus) *Report + func (r *Report) WriteHTML(path string) error + func (r *Report) WriteJSON(path string) error + func (r *Report) WriteReports(dir string) (jsonPath, htmlPath string, err error) + type RetrievalGate struct + Metric string + Passed bool + Tolerance float64 + type RetrievalMetricValues struct + MAP float64 + MRR float64 + NDCGAt10 float64 + RecallAt map[int]float64 + type RetrievalMetrics struct + CorpusVersion string + Gate RetrievalGate + GoldenVersion string + Metrics RetrievalMetricValues + QueryCount int + RunsAveraged int + func ScoreRetrieval(golden *GoldenSet, search SearchFunc, ks []int) (*RetrievalMetrics, error) + type SearchFunc func(query string, limit int) (ranked []string, err error) + type Tokenizer struct + func NewTokenizer(encoding string) (*Tokenizer, error) + func (t *Tokenizer) Count(text string) int + func (t *Tokenizer) CountTool(tl Tool) int + func (t *Tokenizer) CountToolWithSchema(tl Tool) int + type Tool struct + Description string + Name string + Schema json.RawMessage + Server string + ToolID string + func ProxyToolsForMode(mode string) []Tool