config

package
v0.0.0-...-c1da302 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DefaultProvider string     `json:"default_provider"`
	DefaultModel    string     `json:"default_model"`
	Providers       []Provider `json:"providers"`
}

Config holds the overall configuration, including default settings and providers.

func Load

func Load() (*Config, error)

Load reads the configuration from the specified JSON file path.

func (*Config) Validate

func (c *Config) Validate() error

validate config file

type Model

type Model struct {
	Text        string `json:"text"`
	Description string `json:"description"`
	MaxContext  int    `json:"max_context"`
}

Model represents a configuration model with text, description, and maximum context.

type Provider

type Provider struct {
	Name         string `json:"name"`
	APIURL       string `json:"api_url"`
	APIKeyEnv    string `json:"api_key_env"` // Reference to environment variable
	APIKey       string
	DefaultModel string  `json:"default_model"`
	Models       []Model `json:"models"`
}

Provider encapsulates the details of an API provider, including credentials and available models.

Jump to

Keyboard shortcuts

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