configs

package
v1.0.0-beta.20241028 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientManager

func CreateClientManager(models []Model) *client.ClientManager

func GenerateExampleConfig

func GenerateExampleConfig(filePath string) error

Types

type Config

type Config struct {
	Port      int      `toml:"port"`
	Host      string   `toml:"host"`
	LogFile   string   `toml:"log_file"`
	AuthToken []string `toml:"auth_token"`
	Models    []Model  `toml:"models"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type Model

type Model struct {
	Name             string  `toml:"name"`
	BaseURL          string  `toml:"base_url"`
	Type             string  `toml:"type"`
	APIKey           string  `toml:"api_key"`
	ModelName        string  `toml:"model_name"`
	MaxTokens        int     `toml:"max_tokens"`
	Temperature      float32 `toml:"temperature"`
	Prompt           string  `toml:"prompt"`
	RateLimit        float64 `toml:"rate_limit"`
	Endpoint         string  `toml:"endpoint"`
	CacheExpireHours int     `toml:"cache_expire_hours"`
}

Jump to

Keyboard shortcuts

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