Documentation
¶
Index ¶
- func TrackCost(toolName, serverName string, tokenCount int64)
- func TrackCostFromStrings(toolName, serverName, requestJSON, responseJSON string)
- type Clock
- type CostBreakdown
- type CostTracker
- func (c *CostTracker) FormatCLI(showByTool, showByServer bool) string
- func (c *CostTracker) FormatJSON() (string, error)
- func (c *CostTracker) GetBreakdown() CostBreakdown
- func (c *CostTracker) GetByServer() map[string]int64
- func (c *CostTracker) GetByTool() map[string]int64
- func (c *CostTracker) GetTotal() int64
- func (c *CostTracker) Reset()
- func (c *CostTracker) Track(toolName, serverName string, tokenCount int64)
- type RealClock
- type ServerCost
- type ToolCost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrackCostFromStrings ¶
func TrackCostFromStrings(toolName, serverName, requestJSON, responseJSON string)
Types ¶
type CostBreakdown ¶
type CostBreakdown struct {
ByTool []ToolCost `json:"by_tool"`
ByServer []ServerCost `json:"by_server"`
Total int64 `json:"total"`
Duration time.Duration `json:"duration"`
}
type CostTracker ¶
type CostTracker struct {
// contains filtered or unexported fields
}
func GlobalCostTracker ¶
func GlobalCostTracker() *CostTracker
func NewCostTracker ¶
func NewCostTracker() *CostTracker
func (*CostTracker) FormatCLI ¶
func (c *CostTracker) FormatCLI(showByTool, showByServer bool) string
func (*CostTracker) FormatJSON ¶
func (c *CostTracker) FormatJSON() (string, error)
func (*CostTracker) GetBreakdown ¶
func (c *CostTracker) GetBreakdown() CostBreakdown
func (*CostTracker) GetByServer ¶
func (c *CostTracker) GetByServer() map[string]int64
func (*CostTracker) GetByTool ¶
func (c *CostTracker) GetByTool() map[string]int64
func (*CostTracker) GetTotal ¶
func (c *CostTracker) GetTotal() int64
func (*CostTracker) Reset ¶
func (c *CostTracker) Reset()
func (*CostTracker) Track ¶
func (c *CostTracker) Track(toolName, serverName string, tokenCount int64)
type ServerCost ¶
Click to show internal directories.
Click to hide internal directories.