Documentation
¶
Overview ¶
Package obol is a thin purego binding over obol-core's C ABI. The Rust core owns all accounting; this package only marshals C strings and unmarshals JSON. No cgo: the native library is loaded at runtime via github.com/ebitengine/purego (CGO_ENABLED=0 works).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Approximation ¶
type CostEstimate ¶
type CostEstimate struct {
TotalUSD float64 `json:"total_usd"`
PerModel []ModelCost `json:"per_model"`
Tokens TokenBuckets `json:"tokens"`
UnpricedModels []string `json:"unpriced_models"`
Approximations []Approximation `json:"approximations"`
PricingAsOf string `json:"pricing_as_of"`
}
func EstimatePath ¶
func EstimatePath(path, dialect string) (*CostEstimate, error)
EstimatePath estimates a transcript file's cost. dialect is required.
type ModelCost ¶
type ModelCost struct {
Model string `json:"model"`
Provider string `json:"provider"`
Tokens TokenBuckets `json:"tokens"`
SubtotalUSD float64 `json:"subtotal_usd"`
}
type ObolError ¶
type ObolError struct {
Code int `json:"code"`
Kind string `json:"kind"`
Message string `json:"message"`
}
ObolError carries the FFI error envelope.
type RefreshReport ¶
type RefreshReport struct {
Models uint64 `json:"models"`
AsOf string `json:"as_of"`
WrittenTo string `json:"written_to"`
}
func Refresh ¶
func Refresh(asOf string) (*RefreshReport, error)
Refresh pulls fresh pricing tables. asOf is the caller's date string.
Click to show internal directories.
Click to hide internal directories.