Documentation
¶
Overview ¶
Package autocomplete provides LLM-powered ghost text suggestions for task input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles autocomplete requests with debouncing and cancellation.
func NewService ¶
NewService creates a new autocomplete service. apiKey can be empty - it will check ANTHROPIC_API_KEY env var.
func (*Service) Cancel ¶
func (s *Service) Cancel()
Cancel is a no-op - cancellation is handled via context.
func (*Service) GenerateTitle ¶
GenerateTitle generates a concise task title from the description/body. This is used when the user provides a description but no title.
func (*Service) GetSuggestion ¶
func (s *Service) GetSuggestion(ctx context.Context, input, fieldType, project, extraContext string, recentTasks []string) *Suggestion
GetSuggestion gets an autocomplete suggestion for the given input. This is a blocking call that should be run in a goroutine. Returns nil if cancelled, timed out, or no good suggestion. The context should be cancelled if the user continues typing. recentTasks provides context about recent task titles for better suggestions.
func (*Service) IsAvailable ¶
IsAvailable returns true if the autocomplete service has an API key configured.
type Suggestion ¶
type Suggestion struct {
Text string // The suggested completion text (suffix to append)
FullText string // The full text including user input + suggestion
RequestID int64 // To match responses with requests
}
Suggestion represents a completion suggestion from the LLM.