Documentation
¶
Index ¶
Constants ¶
View Source
const (
ModelCacheTTL = 6 * time.Hour
)
Variables ¶
This section is empty.
Functions ¶
func IsCacheValid ¶
func IsCacheValid(cache *ModelCache) bool
func WriteModelCache ¶
func WriteModelInfoCache ¶ added in v0.0.267
func WriteModelInfoCache(provider string, modelInfos []CachedModel) error
Types ¶
type CachedModel ¶ added in v0.0.267
type CachedModel struct {
ID string `json:"id"`
DisplayName string `json:"display_name,omitempty"`
Created int64 `json:"created,omitempty"`
OwnedBy string `json:"owned_by,omitempty"`
InputLimit int `json:"input_limit,omitempty"`
InputPrice float64 `json:"input_price,omitempty"`
OutputPrice float64 `json:"output_price,omitempty"`
}
type ModelCache ¶
type ModelCache struct {
Models []string `json:"models"`
ModelInfos []CachedModel `json:"model_infos,omitempty"`
FetchedAt time.Time `json:"fetched_at"`
}
func ReadModelCache ¶
func ReadModelCache(provider string) (*ModelCache, error)
Click to show internal directories.
Click to hide internal directories.