Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugLog ¶
type DebugLog struct {
// contains filtered or unexported fields
}
func NewDebugLog ¶
type TokenLogger ¶
type TokenLogger struct {
// contains filtered or unexported fields
}
func NewTokenLogger ¶
func NewTokenLogger(cfg config.TokenLogConfig) (*TokenLogger, error)
func (*TokenLogger) Close ¶
func (l *TokenLogger) Close()
func (*TokenLogger) DroppedEntries ¶
func (l *TokenLogger) DroppedEntries() int64
DroppedEntries returns the total number of log entries dropped due to channel overflow.
func (*TokenLogger) Log ¶
func (l *TokenLogger) Log(entry UsageLog)
func (*TokenLogger) Mode ¶
func (l *TokenLogger) Mode() string
func (*TokenLogger) Path ¶
func (l *TokenLogger) Path() string
func (*TokenLogger) QueryUsageLogs ¶
func (l *TokenLogger) QueryUsageLogs(filter UsageLogFilter) ([]UsageLog, UsageLogSummary, error)
type UsageInfo ¶
type UsageInfo struct {
ResponseModel string
PromptTokens int
CompletionTokens int
TotalTokens int
InputTokens int
OutputTokens int
}
func ExtractStreamingUsage ¶
func ExtractUsage ¶
type UsageLog ¶
type UsageLog struct {
Time string `json:"time"`
RequestID string `json:"request_id,omitempty"`
Backend string `json:"backend"`
ClientProtocol string `json:"client_protocol"`
BackendProtocol string `json:"backend_protocol"`
ClientKey string `json:"client_key"`
RequestModel string `json:"request_model,omitempty"`
ForwardedModel string `json:"forwarded_model,omitempty"`
ResponseModel string `json:"response_model,omitempty"`
StatusCode int `json:"status_code"`
DurationMs int64 `json:"duration_ms,omitempty"`
RetryCount int `json:"retry_count,omitempty"`
ErrorCategory string `json:"error_category,omitempty"`
Transport string `json:"transport,omitempty"`
PromptTokens int `json:"prompt_tokens,omitempty"`
CompletionTokens int `json:"completion_tokens,omitempty"`
TotalTokens int `json:"total_tokens,omitempty"`
InputTokens int `json:"input_tokens,omitempty"`
OutputTokens int `json:"output_tokens,omitempty"`
Error string `json:"error,omitempty"`
}
type UsageLogFilter ¶
type UsageLogSummary ¶
Click to show internal directories.
Click to hide internal directories.