Changeset 0.22.2 (#96)

This commit is contained in:
2026-03-02 10:31:18 +00:00
parent cae6fd9f93
commit a44c768741
20 changed files with 1563 additions and 22 deletions

View File

@@ -549,6 +549,7 @@ type UsageEntry struct {
CacheReadTokens int `json:"cache_read_tokens" db:"cache_read_tokens"`
CostInput *float64 `json:"cost_input,omitempty" db:"cost_input"`
CostOutput *float64 `json:"cost_output,omitempty" db:"cost_output"`
RoutingDecision JSONMap `json:"routing_decision,omitempty" db:"routing_decision"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
}
@@ -937,3 +938,22 @@ type CapabilityOverride struct {
CreatedAt string `json:"created_at" db:"created_at"`
}
// =========================================
// ROUTING POLICIES (v0.22.2)
// =========================================
// RoutingPolicy is one routing rule that controls how requests are
// dispatched to provider configs. Stored in the routing_policies table.
type RoutingPolicy struct {
ID string `json:"id" db:"id"`
Name string `json:"name" db:"name"`
Scope string `json:"scope" db:"scope"` // "global" or "team"
TeamID *string `json:"team_id,omitempty" db:"team_id"`
Priority int `json:"priority" db:"priority"` // lower = first
Type string `json:"policy_type" db:"policy_type"` // provider_prefer, team_route, cost_limit, model_alias
Config JSONMap `json:"config" db:"config"` // type-specific JSONB
IsActive bool `json:"is_active" db:"is_active"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}