Documentation
¶
Index ¶
- type FuzzyMatcher
- func (fm *FuzzyMatcher) FindBest(query string, agents []*parser.AgentSpec) *parser.AgentSpec
- func (fm *FuzzyMatcher) FindMultiple(query string, agents []*parser.AgentSpec, limit int) []*parser.AgentSpec
- func (fm *FuzzyMatcher) MultiFieldSearch(query string, agents []*parser.AgentSpec, fields []string, limit int) []*parser.AgentSpec
- func (fm *FuzzyMatcher) Score(s1, s2 string) float64
- func (fm *FuzzyMatcher) ScoreByField(agent *parser.AgentSpec, field, query string) float64
- func (fm *FuzzyMatcher) SetThreshold(threshold float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuzzyMatcher ¶
type FuzzyMatcher struct {
// contains filtered or unexported fields
}
FuzzyMatcher provides fuzzy string matching capabilities for agent discovery
func NewFuzzyMatcher ¶
func NewFuzzyMatcher(threshold float64) *FuzzyMatcher
NewFuzzyMatcher creates a new fuzzy matcher with the specified threshold threshold should be between 0.0 and 1.0, where higher values require closer matches
func (*FuzzyMatcher) FindBest ¶
FindBest finds the best matching agent from the provided list Returns nil if no match exceeds the threshold
func (*FuzzyMatcher) FindMultiple ¶
func (fm *FuzzyMatcher) FindMultiple(query string, agents []*parser.AgentSpec, limit int) []*parser.AgentSpec
FindMultiple finds multiple matching agents, sorted by score (best first) If limit is 0, returns all matches above threshold
func (*FuzzyMatcher) MultiFieldSearch ¶
func (fm *FuzzyMatcher) MultiFieldSearch(query string, agents []*parser.AgentSpec, fields []string, limit int) []*parser.AgentSpec
MultiFieldSearch searches across multiple fields with relevance scoring
func (*FuzzyMatcher) Score ¶
func (fm *FuzzyMatcher) Score(s1, s2 string) float64
Score calculates similarity between two strings using multiple algorithms
func (*FuzzyMatcher) ScoreByField ¶
func (fm *FuzzyMatcher) ScoreByField(agent *parser.AgentSpec, field, query string) float64
ScoreByField calculates similarity score between query and specific agent field
func (*FuzzyMatcher) SetThreshold ¶
func (fm *FuzzyMatcher) SetThreshold(threshold float64)
SetThreshold updates the matching threshold