X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/5dbb2e42e88e78bfc79b473b5b1dc466d8dbbf62..80e348724041a694002fc38f57e8868b9b9a2be9:/config.go diff --git a/config.go b/config.go index 1d68b67..fb24c20 100644 --- a/config.go +++ b/config.go @@ -19,6 +19,19 @@ const ( configEndpointAPI = "api" ) +// Config holds the settings of config.json in the data directory. +type Config struct { + Endpoint string `json:"endpoint"` + Voice VoiceConfig `json:"voice"` + Compactor ModelConfig `json:"compactor"` +} + +// ModelConfig names a model and its reasoning effort. +type ModelConfig struct { + Model string `json:"model"` + Effort string `json:"effort"` +} + // loadConfig reads config.json in dir over the defaults. A missing file gives // the defaults. An unknown field is an error, so a typo does not become a // silent default. @@ -52,13 +65,6 @@ func loadConfig(dir string) (Config, error) { return config, nil } -// Config holds the settings of config.json in the data directory. -type Config struct { - Endpoint string `json:"endpoint"` - Voice VoiceConfig `json:"voice"` - Compactor ModelConfig `json:"compactor"` -} - // validate makes sure that each setting has a valid value. func (c Config) validate() error { if c.Endpoint != configEndpointChatGPT && c.Endpoint != configEndpointAPI { @@ -72,12 +78,6 @@ func (c Config) validate() error { return nil } -// ModelConfig names a model and its reasoning effort. -type ModelConfig struct { - Model string `json:"model"` - Effort string `json:"effort"` -} - // defaultConfig returns the settings that apply when config.json does not // set them. func defaultConfig() Config {