Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CategoryRule ¶
CategoryRule is a single pattern → category mapping used by BulkSaveCategoryRules.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages the Ollama conversation and executes tool calls.
func (*Client) Ask ¶
Ask appends the user question to history and returns a Cmd that immediately delivers LLMStreamStartMsg. Content tokens arrive as LLMStreamMsg events, terminated by LLMStreamDoneMsg or LLMErrorMsg.
func (*Client) ClearHistory ¶
func (c *Client) ClearHistory()
ClearHistory resets the conversation to just the system prompt.
type LLMDebugMsg ¶
type LLMDebugMsg struct {
Text string
}
LLMDebugMsg carries a single debug line describing an LLM roundtrip event.
type LLMErrorMsg ¶
type LLMErrorMsg struct {
Err error
}
LLMErrorMsg is returned when the LLM call fails.
type LLMStreamDoneMsg ¶
type LLMStreamDoneMsg struct{}
LLMStreamDoneMsg signals the stream finished successfully.
type LLMStreamMsg ¶
type LLMStreamMsg struct {
Content string
}
LLMStreamMsg carries one chunk of text from the model's final response.
type LLMStreamStartMsg ¶
LLMStreamStartMsg is returned by Ask; it carries the channel that delivers subsequent stream events (LLMStreamMsg / LLMStreamDoneMsg / LLMErrorMsg).
type Tools ¶
type Tools struct {
GetUncategorizedTransactions func(offset int) []string
GetTransactions func(filters TransactionFilters) []string
GetMonthlySummary func(months []string) []string
GetCategories func() []string
SaveCategoryRule func(pattern, category string) error
BulkSaveCategoryRules func(rules []CategoryRule) (saved int, err error)
}
Tools holds callback functions the LLM can invoke. Each field is wired up by the caller (app.go) which owns the data.
type TransactionFilters ¶
type TransactionFilters struct {
Category string // filter by category name
Month string // "YYYY-MM" format, e.g. "2024-01"
Type string // "expense", "income", or "investment"
}
TransactionFilters holds optional filters for the GetTransactions tool.