config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 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 {
	APIURL         string `toml:"CAI_API_URL"`
	Model          string `toml:"CAI_MODEL"`
	Provider       string `toml:"CAI_PROVIDER"`
	APIToken       string `toml:"CAI_API_TOKEN"`
	Language       string `toml:"CAI_LANGUAGE"`
	PromptTemplate string `toml:"CAI_PROMPT_TEMPLATE"`
	TimeoutSeconds int    `toml:"CAI_TIMEOUT_SECONDS"`
}

Config holds the application configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default configuration

func Load

func Load(configFile string) (*Config, error)

Load loads the configuration from the specified file

func (*Config) GetPromptTemplatePath

func (c *Config) GetPromptTemplatePath(configFile string) string

GetPromptTemplatePath returns the full path to the prompt template file

func (*Config) Save

func (c *Config) Save(configFile string) error

Save saves the configuration to the specified file

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

Jump to

Keyboard shortcuts

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