Documentation
¶
Overview ¶
Package catalog prices token classes against the pinned sheets.
Index ¶
Constants ¶
const ( RegionGlobal = focus.RegionGlobal TierStandard = "standard" )
Region and tier values the sheets use for default routing.
Variables ¶
var ErrNoPrice = errors.New("catalog: no price and no fallback")
ErrNoPrice means a sheet has neither a price nor a fallback for a class.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is one pinned release.
func (*Catalog) Lookup ¶
Lookup prices one token class. A model, tier or class the sheet does not name falls to the sheet's non-zero fallback row, and the Price says so.
func (*Catalog) ServiceProviderName ¶
ServiceProviderName is the provider's name as its sheet states it.
type Price ¶
type Price struct {
SkuPriceID string
ListUnitPrice decimal.Decimal
PricingUnit string
Fallback bool
FallbackBasis string
ResidencyMultiplier *decimal.Decimal
}
Price is the answer to a Query.
type Query ¶
type Query struct {
Provider string
Model string
Class focus.TokenClass
ServiceTier string
Region string
// ContextInputTokens selects a long-context tier. Zero means the agent
// reported no per-request input, and the lowest tier applies.
ContextInputTokens int64
At time.Time
}
Query names one token class of one request.