Documentation
¶
Overview ¶
Package gateway is an optional runtime.Runtime decorator (backlog AO-042) that puts spend caps, tracing, and failover in front of any underlying runtime — the role agentgateway/plano play in front of providers. Wire one gateway per flow to enforce a per-flow budget; the Tracer hook is where OpenTelemetry plugs in so every model call is traced.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBudgetExceeded = errors.New("gateway: per-flow spend cap exceeded")
ErrBudgetExceeded is returned when a dispatch would exceed the spend cap.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway wraps an underlying runtime.
type Options ¶
type Options struct {
Limit float64 // spend cap; 0 = unlimited
DefaultCost float64 // cost charged per dispatch when no per-agent cost
Costs map[string]float64 // per-agent cost overrides
Tracer Tracer // call tracer (OTel adapter, etc.)
Failover map[string]string // agent -> fallback agent on dispatch error
}
Options configures a gateway.
Click to show internal directories.
Click to hide internal directories.