store

package
v1.3.39 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package store persists user-selected LLM providers and credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeDefault

func ChangeDefault(Model types.LLMProvider) error

ChangeDefault updates the default LLM provider selection in the config.

Types

type Config

type Config struct {
	Default      types.LLMProvider   `json:"default"`
	LLMProviders []types.LLMProvider `json:"models"`
}

Config describes the on-disk structure for all saved LLM providers.

func ListSavedModels

func ListSavedModels() (*Config, error)

ListSavedModels loads all persisted LLM provider configurations.

type LLMProvider

type LLMProvider struct {
	LLM    types.LLMProvider `json:"model"`
	APIKey string            `json:"api_key"`
}

LLMProvider represents a single stored LLM provider and its credential.

type StoreMethods added in v1.3.35

type StoreMethods struct {
	// contains filtered or unexported fields
}

func KeyringInit added in v1.3.35

func KeyringInit() (*StoreMethods, error)

Initializes Keyring instance

func (*StoreMethods) DefaultLLMKey added in v1.3.35

func (s *StoreMethods) DefaultLLMKey() (*LLMProvider, error)

DefaultLLMKey returns the currently selected default LLM provider, if any.

func (*StoreMethods) DeleteModel added in v1.3.35

func (s *StoreMethods) DeleteModel(Model types.LLMProvider) error

DeleteModel removes the specified provider from the saved configuration.

func (*StoreMethods) Save added in v1.3.35

func (s *StoreMethods) Save(LLMConfig LLMProvider) error

Save persists or updates an LLM provider entry, marking it as the default.

func (*StoreMethods) UpdateAPIKey added in v1.3.35

func (s *StoreMethods) UpdateAPIKey(Model types.LLMProvider, APIKey string) error

UpdateAPIKey rotates the credential for an existing provider entry.

Jump to

Keyboard shortcuts

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