store

package
v1.3.33 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.

func DeleteModel

func DeleteModel(Model types.LLMProvider) error

DeleteModel removes the specified provider from the saved configuration.

func Save

func Save(LLMConfig LLMProvider) error

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

func UpdateAPIKey

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

UpdateAPIKey rotates the credential for an existing provider entry.

Types

type Config

type Config struct {
	Default      types.LLMProvider `json:"default"`
	LLMProviders []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.

func DefaultLLMKey

func DefaultLLMKey() (*LLMProvider, error)

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

Jump to

Keyboard shortcuts

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