finance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package finance provides portfolio monitoring, stock quotes, price alerts, and market briefings. Uses Yahoo Finance for real-time market data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Holding

type Holding struct {
	Symbol string  `json:"symbol"`
	Shares float64 `json:"shares"`
}

Holding represents a single position in the user's portfolio.

type Module

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

Module implements the finance module.

func New

func New(cfg *config.Config, mem *memory.Store, ag *agent.Agent) *Module

New creates and initialises a finance module, registering its tools with the agent.

func (*Module) Description

func (m *Module) Description() string

func (*Module) Init

func (m *Module) Init(cfg map[string]any, mem *memory.Store) error

func (*Module) Name

func (m *Module) Name() string

func (*Module) ScheduledTasks

func (m *Module) ScheduledTasks() []ScheduledTask

func (*Module) Tools

func (m *Module) Tools() []agent.Tool

type PriceAlert

type PriceAlert struct {
	Symbol    string  `json:"symbol"`
	Above     float64 `json:"above,omitempty"`
	Below     float64 `json:"below,omitempty"`
	Triggered bool    `json:"triggered,omitempty"`
}

PriceAlert fires when a ticker crosses a threshold.

type ScheduledTask

type ScheduledTask struct {
	Name string
	Cron string
	Task func(ctx context.Context, a *agent.Agent) error
}

ScheduledTask matches the interface expected by the module system.

Jump to

Keyboard shortcuts

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