Documentation
¶
Overview ¶
Package pricebook defines the serialized AI Gateway model price book.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Row ¶
type Row struct {
Provider string `json:"provider"`
Model string `json:"model"`
InputPrice *int64 `json:"input_price"`
OutputPrice *int64 `json:"output_price"`
CacheReadPrice *int64 `json:"cache_read_price"`
CacheWritePrice *int64 `json:"cache_write_price"`
}
Row is one provider and model entry in the generated price book. Pointer fields preserve the distinction between a missing price and an explicit zero.
NOTE: the batch SQL upsert extracts these fields from the raw JSON by name, so the tags here and that query must stay in sync. TestSeedFromBytes/ RowTagsMatchSQLColumns in the parent package guards that.
func (Row) SamePrices ¶
SamePrices reports whether two rows carry identical prices. Provider and model are ignored, so it is only meaningful for rows with the same Key. A price moving to or from null counts as a difference, matching the null handling in the batch SQL upsert.