catalog

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package catalog implements provider model discovery with a small, account-and-endpoint-scoped last-good cache and non-blocking snapshot reads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCachePath

func DefaultCachePath(environ []string) string

DefaultCachePath derives the platform cache location from the caller's environment. Keeping this explicit prevents embedded callers and tests from accidentally reading or replacing another user's model catalog.

Types

type Catalog

type Catalog struct {
	Adapters  map[string]runner.Adapter
	Config    config.Config
	CachePath string
	Now       func() time.Time
}

func New

func New(adapters map[string]runner.Adapter, cfg config.Config, cachePath string) *Catalog

func (*Catalog) CachedModels

func (c *Catalog) CachedModels(provider, account string, runtime runner.ModelListRequest) ([]runner.ModelInfo, bool)

CachedModels returns an account-scoped snapshot without contacting the provider. It preserves the last verified availability so an interactive picker can open immediately; Origin and AgeSeconds still identify stale data.

func (*Catalog) Models

func (c *Catalog) Models(ctx context.Context, provider string, refresh bool, runtime runner.ModelListRequest) ([]runner.ModelInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL