X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/522d7fd117285e4e4ce3ea5ec9b5a1722521b681..c781f79f3c8cb9a7577ee1574d196988da2719b3:/config.go?ds=sidebyside diff --git a/config.go b/config.go index 3b5172d..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,12 +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"` - 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 { @@ -71,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 {