suggestions

package
v0.3.20 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package suggestions provides template suggestion and smart completion functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector analyzes user input to suggest appropriate tools

func NewDetector

func NewDetector() *Detector

NewDetector creates a new suggestion detector with default patterns

func (*Detector) AnalyzeInput

func (d *Detector) AnalyzeInput(input string) []Suggestion

AnalyzeInput analyzes user input and returns suggestions

type FeedbackEvent

type FeedbackEvent struct {
	ToolName  string
	Pattern   string // Pattern that triggered the suggestion
	Feedback  FeedbackType
	Timestamp time.Time
}

FeedbackEvent records user interaction with a suggestion

type FeedbackType

type FeedbackType int

FeedbackType represents user feedback on a suggestion

const (
	// FeedbackAccepted indicates the user accepted a suggestion
	FeedbackAccepted FeedbackType = iota
	// FeedbackRejected indicates the user rejected a suggestion
	FeedbackRejected
	// FeedbackIgnored indicates the user ignored a suggestion
	FeedbackIgnored
)

type Learner

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

Learner tracks suggestion effectiveness and adjusts confidence

func NewLearner

func NewLearner() *Learner

NewLearner creates a new learning system

func (*Learner) AdjustSuggestion

func (l *Learner) AdjustSuggestion(suggestion *Suggestion)

AdjustSuggestion applies learned adjustments to a suggestion

func (*Learner) ClearHistory

func (l *Learner) ClearHistory()

ClearHistory clears all feedback history and adjustments

func (*Learner) GetAdjustments

func (l *Learner) GetAdjustments() map[string]float64

GetAdjustments returns current confidence adjustments for all tools

func (*Learner) GetRecentHistory

func (l *Learner) GetRecentHistory(limit int) []FeedbackEvent

GetRecentHistory returns recent feedback events (max 20)

func (*Learner) GetStats

func (l *Learner) GetStats() map[string]ToolStats

GetStats returns statistics about suggestion effectiveness

func (*Learner) RecordFeedback

func (l *Learner) RecordFeedback(toolName string, pattern string, feedback FeedbackType)

RecordFeedback records user feedback on a suggestion

type Suggestion

type Suggestion struct {
	ToolName   string  // Name of the suggested tool
	Confidence float64 // Confidence score (0.0 - 1.0)
	Reason     string  // Human-readable reason for the suggestion
	Action     string  // Suggested action text (e.g., ":read /path/to/file")
}

Suggestion represents a tool suggestion with confidence score

type ToolStats

type ToolStats struct {
	ToolName             string
	Total                int
	Accepted             int
	Rejected             int
	Ignored              int
	AcceptanceRate       float64
	ConfidenceAdjustment float64
}

ToolStats contains statistics for a specific tool

Jump to

Keyboard shortcuts

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