Documentation
¶
Index ¶
- Variables
- type Session
- type StageCounts
- type Status
- type Store
- func (s *Store) AddUsage(ctx context.Context, id string, cost float64, tokens int) error
- func (s *Store) CheckBudget(ctx context.Context, id string) error
- func (s *Store) Close() error
- func (s *Store) Complete(ctx context.Context, id string, cost float64, tokens int) error
- func (s *Store) Create(ctx context.Context, tenantID, agentID, reasoning string, maxCost float64) (*Session, error)
- func (s *Store) Get(ctx context.Context, id string) (*Session, error)
- func (s *Store) GetStageCounts(ctx context.Context, sessionID string) (*StageCounts, error)
- func (s *Store) IncrementStageCount(ctx context.Context, sessionID, stage string) error
- func (s *Store) Join(ctx context.Context, id, tenantID string) (*Session, error)
- func (s *Store) ListByTenant(ctx context.Context, tenantID string, status Status) ([]*Session, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionBudgetExceeded = errors.New("session budget exceeded")
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
AgentID string `json:"agent_id"`
Status Status `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
TotalCost float64 `json:"total_cost"`
TotalTokens int `json:"total_tokens"`
MaxCost float64 `json:"max_cost,omitempty"`
Reasoning string `json:"reasoning,omitempty"`
}
type StageCounts ¶
Click to show internal directories.
Click to hide internal directories.