prechecks

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check(evaluationContext models.EvaluationContext) models.StageResult
}

type FormatChecker

type FormatChecker struct {
}

func NewFormatChecker

func NewFormatChecker() *FormatChecker

func (*FormatChecker) Check

func (c *FormatChecker) Check(evaluationContext models.EvaluationContext) models.StageResult

type LengthChecker

type LengthChecker struct {
}

func NewLengthChecker

func NewLengthChecker() *LengthChecker

func (*LengthChecker) Check

func (c *LengthChecker) Check(evaluationContext models.EvaluationContext) models.StageResult

LengthChecker scores an answer based on its length relative to the query. It computes the character ratio between answer and query, penalizing answers that are too short (score 0.0) or excessively long (score 0.5).

type OverlapChecker

type OverlapChecker struct {
	MinOverlapThreshold float64
}

func NewOverlapChecker

func NewOverlapChecker() *OverlapChecker

func (*OverlapChecker) Check

func (c *OverlapChecker) Check(evaluationContext models.EvaluationContext) models.StageResult

OverlapChecker scores an answer based on keyword overlap with the query. It tokenizes both strings, computes the ratio of shared unique words, and returns a low score if the answer doesn't share enough terms with the query.

type StageRunner

type StageRunner struct {
	Checkers []Checker
}

func NewStageRunner

func NewStageRunner(checkers []Checker) *StageRunner

func (*StageRunner) Run

func (r *StageRunner) Run(evaluationContext models.EvaluationContext) []models.StageResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL