Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateTokens ¶ added in v0.7.0
func EstimateTokens(req *CountTokensRequest) int
EstimateTokens calculates accurate input tokens across Claude & OpenAI schemas
Types ¶
type AccountHealth ¶
type AccountHealth struct {
ProviderID string `json:"provider_id"`
AccountID string `json:"account_id"`
Status string `json:"status"` // "healthy", "refreshing", "expired", "error"
LastCheck time.Time `json:"last_check"`
LastError string `json:"last_error,omitempty"`
LatencyMs int64 `json:"latency_ms"`
}
type CountTokensRequest ¶ added in v0.7.0
type CountTokensRequest struct {
Model string `json:"model"`
Messages []interface{} `json:"messages"`
System interface{} `json:"system,omitempty"`
Tools []interface{} `json:"tools,omitempty"`
}
CountTokensRequest mirrors Anthropic's count_tokens payload
type CountTokensResponse ¶ added in v0.7.0
type CountTokensResponse struct {
InputTokens int `json:"input_tokens"`
}
CountTokensResponse represents the standard token count return
type ProviderRegistry ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
var GlobalScheduler *Scheduler
func InitScheduler ¶
func InitScheduler(registry ProviderRegistry, interval time.Duration) *Scheduler
func (*Scheduler) ListHealth ¶
func (s *Scheduler) ListHealth() []*AccountHealth
func (*Scheduler) RunHealthCheck ¶
Click to show internal directories.
Click to hide internal directories.