Versions in this module Expand all Collapse all v0 v0.2.0 Jun 7, 2026 v0.1.0 Jun 7, 2026 Changes in this version + const ModelClaudeHaiku + const ModelClaudeOpus + const ModelClaudeSonnet + var ErrNoJSONFound = errors.New("no JSON block found in response") + func AggregateScores(scores []float64, weights []float64) float64 + func ScoreToStatus(score float64) types.Status + func TruncateSpec(content string, maxChars int) (string, bool) + type AnthropicProvider struct + func NewAnthropicProvider(apiKey string, config *ProviderConfig) *AnthropicProvider + func (p *AnthropicProvider) Complete(ctx context.Context, req *CompletionRequest) (*CompletionResponse, error) + func (p *AnthropicProvider) DefaultModel() string + func (p *AnthropicProvider) Name() string + func (p *AnthropicProvider) SetDefaultModel(model string) + type CategoryEvaluationResponse struct + Findings []FindingResponse + type CategoryResult struct + Findings []Finding + Name string + Score float64 + type ClaudeEvaluator struct + func NewClaudeEvaluator(provider Provider, spec *types.APIStyleSpec) *ClaudeEvaluator + func NewClaudeEvaluatorWithRubric(provider Provider, rubricSet *RubricSet) *ClaudeEvaluator + func (e *ClaudeEvaluator) Evaluate(ctx context.Context, specBytes []byte, opts *Options) (*EvaluationReport, error) + func (e *ClaudeEvaluator) EvaluateCategory(ctx context.Context, specBytes []byte, category string, opts *Options) (*CategoryResult, error) + func (e *ClaudeEvaluator) RubricSet() *RubricSet + type CompletionRequest struct + MaxTokens int + Metadata map[string]string + Model string + StopSequences []string + SystemPrompt string + Temperature float64 + UserPrompt string + type CompletionResponse struct + Content string + FinishReason string + Model string + Usage *TokenUsage + type Criterion struct + BadExamples []string + Category string + GoodExamples []string + Prompt string + Rationale string + References []types.Reference + RequiresContext bool + RuleID string + RuleTitle string + Severity types.Severity + Weight float64 + type EvaluationReport struct + Categories []CategoryResult + Findings []Finding + Metadata ReportMetadata + Status types.Status + Summary EvaluationSummary + func NewEvaluationReport() *EvaluationReport + func (r *EvaluationReport) AddFinding(f Finding) + func (r *EvaluationReport) CalculateScores() + func (r *EvaluationReport) HasCriticalFailures() bool + func (r *EvaluationReport) HasFailures() bool + type EvaluationSummary struct + CategoryScores map[string]float64 + FailedRules int + OverallScore float64 + PassedRules int + SkippedRules int + TotalRules int + type Evaluator interface + Evaluate func(ctx context.Context, specBytes []byte, opts *Options) (*EvaluationReport, error) + EvaluateCategory func(ctx context.Context, specBytes []byte, category string, opts *Options) (*CategoryResult, error) + type Finding struct + Category string + Examples []string + Locations []string + Passed bool + Reasoning string + RuleID string + RuleTitle string + Score float64 + Severity types.Severity + Suggestions []string + Weight float64 + func ParseCategoryEvaluation(response string, criteria []*Criterion) ([]Finding, error) + func ParseSingleEvaluation(response string, criterion *Criterion) (*Finding, error) + type FindingResponse struct + Examples []string + Locations []string + Passed bool + Reasoning string + RuleID string + Score float64 + Suggestions []string + type Options struct + Categories []string + FileName string + IncludeReasoning bool + MaxConcurrency int + MaxTokens int + Model string + RuleIDs []string + Temperature float64 + func DefaultOptions() *Options + type PromptBuilder struct + SystemPrompt string + func NewPromptBuilder() *PromptBuilder + func (pb *PromptBuilder) BuildBatchEvaluation(rubricSet *RubricSet, specContent string) string + func (pb *PromptBuilder) BuildCategoryEvaluation(category string, criteria []*Criterion, specContent string) string + func (pb *PromptBuilder) BuildSingleEvaluation(criterion *Criterion, specContent string) string + type Provider interface + Complete func(ctx context.Context, req *CompletionRequest) (*CompletionResponse, error) + DefaultModel func() string + Name func() string + type ProviderConfig struct + APIKey string + BaseURL string + DefaultModel string + MaxRetries int + RetryDelay int + Timeout int + func DefaultProviderConfig() *ProviderConfig + type ReportMetadata struct + Duration string + FileName string + Model string + ProfileName string + Timestamp string + type RubricSet struct + Categories map[string][]*Criterion + Criteria map[string]*Criterion + Name string + func BuildRubricSet(spec *types.APIStyleSpec) *RubricSet + func (rs *RubricSet) AllCriteria() []*Criterion + func (rs *RubricSet) CategoryNames() []string + func (rs *RubricSet) FilterByCategory(category string) []*Criterion + func (rs *RubricSet) FilterByRuleIDs(ruleIDs []string) []*Criterion + func (rs *RubricSet) Size() int + func (rs *RubricSet) String() string + type SingleEvaluationResponse struct + Examples []string + Locations []string + Passed bool + Reasoning string + Score float64 + Suggestions []string + type TokenUsage struct + InputTokens int + OutputTokens int + TotalTokens int