Help us shape the future of Go! Take the 2026 Go Developer Survey

skillroute

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayoutSkillDirs   = "skill_dirs"
	MaxSelectionLimit = 64

	RouterName = "bm25"
	// RouterVersion must be bumped whenever the scoring formula (bm25.go score/idf),
	// tokenization, weighting, the textLike threshold, or any RouterParams value changes.
	// TestBM25ScoreRegression (quality_test.go) pins exact scores so a formula change
	// is caught in CI, ensuring the bump is never forgotten.
	RouterVersion   = "bm25-weighted-v1"
	SkillMDWeight   = 4
	PathWeight      = 2
	TextFileWeight  = 1
	TextLikePercent = 85
)

Variables

This section is empty.

Functions

func RouterParams

func RouterParams() map[string]float64

func ValidID

func ValidID(id string) bool

Types

type Corpus

type Corpus struct {
	// contains filtered or unexported fields
}

func NewCorpus

func NewCorpus(files []File) (*Corpus, error)

func (*Corpus) Digest

func (c *Corpus) Digest() string

func (*Corpus) Route

func (c *Corpus) Route(query string, limit int) []Selection

func (*Corpus) SkillIDs

func (c *Corpus) SkillIDs() []string

func (*Corpus) StageFiles

func (c *Corpus) StageFiles(skillID, into string) ([]File, bool)

type File

type File struct {
	Path    string
	Content []byte
	Size    int64
	SHA256  string
}

type Issue

type Issue struct {
	Kind    IssueKind
	Path    string
	SkillID string
	Message string
}

func ValidateFiles

func ValidateFiles(files []File) []Issue

type IssueKind

type IssueKind string
const (
	IssueInvalidPath    IssueKind = "invalid_path"
	IssueRootFile       IssueKind = "root_file"
	IssueInvalidSkillID IssueKind = "invalid_skill_id"
	IssueMissingSkillMD IssueKind = "missing_skill_md"
)

type IssuesError

type IssuesError []Issue

func (IssuesError) Error

func (e IssuesError) Error() string

type Selection

type Selection struct {
	ID    string
	Score float64
}

type Skill

type Skill struct {
	ID     string
	Files  []File
	Tokens []string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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