Documentation
¶
Index ¶
- type Candidate
- type Group
- type Item
- type KeyRef
- type Metadata
- type Metrics
- type Owner
- type Query
- type Resolution
- type Response
- type Summary
- type Totals
- type UsageTrendsBucket
- type UsageTrendsMetrics
- type UsageTrendsQuery
- type UsageTrendsResponse
- type UsageTrendsRow
- type UsageTrendsTotals
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyRef ¶
type KeyRef struct {
Hash, KeyID, WorkspaceID, UserID, TenantID string
}
KeyRef, Candidate, Resolution, Group and Metadata are internal only, never HTTP DTOs.
type Metrics ¶
type Metrics struct {
RequestCount uint64 `json:"request_count"`
SuccessCount uint64 `json:"success_count"`
SuccessRate float64 `json:"success_rate"`
InputTokens uint64 `json:"input_tokens"`
OutputTokens uint64 `json:"output_tokens"`
CachedTokens uint64 `json:"cached_tokens"`
CacheCreationTokens uint64 `json:"cache_creation_tokens"`
TotalTokens uint64 `json:"total_tokens"`
TotalCost string `json:"total_cost"`
}
type Resolution ¶
type Response ¶
type Response struct {
State string `json:"state"`
DataSource string `json:"data_source"`
Window *Window `json:"window"`
GeneratedAt *time.Time `json:"generated_at"`
Summary *Summary `json:"summary"`
Items []Item `json:"items"`
Unattributed *Metrics `json:"unattributed"`
Warnings []string `json:"warnings"`
}
type Totals ¶
type UsageTrendsBucket ¶ added in v1.0.4
type UsageTrendsBucket struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
UsageTrendsMetrics
}
type UsageTrendsMetrics ¶ added in v1.0.4
type UsageTrendsMetrics struct {
Requests uint64 `json:"requests"`
Success uint64 `json:"success"`
Failure uint64 `json:"failure"`
Input uint64 `json:"input_tokens"`
Output uint64 `json:"output_tokens"`
Cached uint64 `json:"cached_tokens"`
CacheCreation uint64 `json:"cache_creation_tokens"`
TotalTokens uint64 `json:"total_tokens"`
FailureRate *float64 `json:"failure_rate"`
AvgLatencyMs *float64 `json:"avg_latency_ms"`
AvgTTFTMs *float64 `json:"avg_ttft_ms"`
}
type UsageTrendsQuery ¶ added in v1.0.4
type UsageTrendsQuery struct {
TimeRange string
}
func ParseUsageTrendsQuery ¶ added in v1.0.4
func ParseUsageTrendsQuery(values url.Values) (UsageTrendsQuery, error)
func (UsageTrendsQuery) BucketSeconds ¶ added in v1.0.4
func (q UsageTrendsQuery) BucketSeconds(window Window) int64
func (UsageTrendsQuery) Validate ¶ added in v1.0.4
func (q UsageTrendsQuery) Validate() error
type UsageTrendsResponse ¶ added in v1.0.4
type UsageTrendsResponse struct {
State string `json:"state"`
DataSource string `json:"data_source"`
Window *Window `json:"window"`
GeneratedAt *time.Time `json:"generated_at"`
BucketSeconds int64 `json:"bucket_seconds"`
Summary *UsageTrendsMetrics `json:"summary"`
Buckets []UsageTrendsBucket `json:"buckets"`
}
type UsageTrendsRow ¶ added in v1.0.4
type UsageTrendsRow struct {
Index uint64
UsageTrendsTotals
}
type UsageTrendsTotals ¶ added in v1.0.4
type UsageTrendsTotals struct {
Requests, Success, Input, Output, Cached, CacheCreation uint64
LatencySumMs, TTFTSumMs, TTFTCount uint64
}
UsageTrendsTotals is an internal aggregate; it never contains request identities.
func (*UsageTrendsTotals) Add ¶ added in v1.0.4
func (t *UsageTrendsTotals) Add(other UsageTrendsTotals)
func (UsageTrendsTotals) Metrics ¶ added in v1.0.4
func (t UsageTrendsTotals) Metrics() UsageTrendsMetrics
Click to show internal directories.
Click to hide internal directories.