ai

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ai provides LLM-powered command interpretation for task management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Type    CommandType `json:"type"`
	TaskID  int64       `json:"task_id,omitempty"`
	Title   string      `json:"title,omitempty"`
	Body    string      `json:"body,omitempty"`
	Status  string      `json:"status,omitempty"`
	Project string      `json:"project,omitempty"`
	Query   string      `json:"query,omitempty"`
	Message string      `json:"message,omitempty"` // Human-readable response
}

Command represents a parsed command from user input.

type CommandService

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

CommandService handles AI command interpretation.

func NewCommandService

func NewCommandService(apiKey string) *CommandService

NewCommandService creates a new command service.

func (*CommandService) InterpretCommand

func (s *CommandService) InterpretCommand(ctx context.Context, input string, cmdCtx *Context) (*Command, error)

InterpretCommand uses an LLM to interpret a natural language command.

func (*CommandService) IsAvailable

func (s *CommandService) IsAvailable() bool

IsAvailable returns true if the service has an API key.

type CommandType

type CommandType string

CommandType represents the type of action to perform.

const (
	CommandCreateTask   CommandType = "create_task"
	CommandUpdateStatus CommandType = "update_status"
	CommandSelectTask   CommandType = "select_task"
	CommandSearchTasks  CommandType = "search_tasks"
	CommandUnknown      CommandType = "unknown"
)

type Context

type Context struct {
	Tasks    []*db.Task
	Projects []*db.Project
}

Context provides information about the current state for command interpretation.

Jump to

Keyboard shortcuts

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