]> git.giacomolli.uk - onechat/blobdiff - config.go
Separate multiline Go statements
[onechat] / config.go
index 1d68b67a39c28716ba4651fc8b8bafd34dfc7d14..fb24c20111448c3baac9597ae2c7e2b6eab98307 100644 (file)
--- a/config.go
+++ b/config.go
@@ -19,6 +19,19 @@ const (
        configEndpointAPI = "api"
 )
 
        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.
 // 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
 }
 
        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 {
 // 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
 }
 
        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 {
 // defaultConfig returns the settings that apply when config.json does not
 // set them.
 func defaultConfig() Config {