go.bigb.es/claudio

v0.7.0
Doc Versions Source

Types

T type DB

src
type DB struct {
	// contains filtered or unexported fields
}

DB wraps a SQLite database used for caching model lists and tracking used models.

f func Open

src
func Open() (*DB, error)

Open creates or opens the cache database in the XDG config directory.

m func (*DB) AddUsedModel

src
func (d *DB) AddUsedModel(id, name string) error

AddUsedModel records a model as recently used (legacy, no provider).

m func (*DB) AddUsedModelForProvider

src
func (d *DB) AddUsedModelForProvider(provider, id, name string) error

AddUsedModelForProvider records a model as recently used for a specific provider.

m func (*DB) Close

src
func (d *DB) Close() error

Close closes the database connection.

m func (*DB) DropAllCaches

src
func (d *DB) DropAllCaches() error

DropAllCaches removes all cached model lists, recently used models, and ollama show caches.

m func (*DB) DropProviderCache

src
func (d *DB) DropProviderCache(provider string) error

DropProviderCache removes the cached model list and recently used models for a specific provider.

m func (*DB) GetModels

src
func (d *DB) GetModels(provider string) ([]byte, bool)

GetModels returns a cached model list for the given provider. Returns nil, false if the cache is empty or expired.

m func (*DB) GetOllamaModelInfo

src
func (d *DB) GetOllamaModelInfo(provider, model string) (modifiedAt string, contextLength int, capabilities string, ok bool)

GetOllamaModelInfo returns cached /api/show info for an Ollama model.

m func (*DB) SetModels

src
func (d *DB) SetModels(provider string, data []byte) error

SetModels stores a model list in the cache for the given provider.

m func (*DB) SetOllamaModelInfo

src
func (d *DB) SetOllamaModelInfo(provider, model, modifiedAt string, contextLength int, capabilities string) error

SetOllamaModelInfo caches /api/show info for an Ollama model.

m func (*DB) UsedModels

src
func (d *DB) UsedModels() ([]UsedModel, error)

UsedModels returns all previously used models, most recent first (legacy, no provider).

m func (*DB) UsedModelsForProvider

src
func (d *DB) UsedModelsForProvider(provider string) ([]UsedModel, error)

UsedModelsForProvider returns previously used models for a provider, most recent first.

T type UsedModel

src
type UsedModel struct {
	ID   string
	Name string
}

UsedModel represents a previously selected OpenRouter model.

Source Files