diff --git a/cmd/backend/backend_main.go b/cmd/backend/backend_main.go index d0277e4..82ea948 100644 --- a/cmd/backend/backend_main.go +++ b/cmd/backend/backend_main.go @@ -189,7 +189,7 @@ func main() { var llmResponder responder.Responder var desClient describer.DescriberClient - if cfg.AI.EnableResponder || cfg.AI.Describer.Enable { + if cfg.AI.EnableResponder || cfg.AI.Triage.Enable { var llmClient llm.OpenAILLMClient if cfg.AI.Model != "" { @@ -206,9 +206,9 @@ func main() { llmResponder = responder.NewLLMResponder(llmManager, cfg.AI.MaxInputCharacters) } - if cfg.AI.Describer.Enable { + if cfg.AI.Triage.Enable { slog.Info("Creating describer client") - desClient = describer.GetNewCachedDescriberClient(dbc, cfg.AI.Describer.CacheExpirationTime) + desClient = describer.GetNewCachedDescriberClient(dbc, cfg.AI.Triage.CacheExpirationTime) } } diff --git a/cmd/triage/main.go b/cmd/triage/main.go index c934ec4..7486c0f 100644 --- a/cmd/triage/main.go +++ b/cmd/triage/main.go @@ -38,7 +38,7 @@ func main() { return } - lf, err := os.OpenFile(cfg.AI.Describer.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + lf, err := os.OpenFile(cfg.AI.Triage.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { fmt.Printf("Could not open logfile: %s\n", err) return @@ -52,7 +52,7 @@ func main() { h := slog.NewTextHandler(teeWriter, &slog.HandlerOptions{Level: programLevel}) slog.SetDefault(slog.New(h)) - switch cfg.AI.Describer.LogLevel { + switch cfg.AI.Triage.LogLevel { case "info": programLevel.Set(slog.LevelInfo) case "warn": @@ -83,7 +83,7 @@ func main() { metricsRegistry := prometheus.NewRegistry() http.Handle("/metrics", promhttp.HandlerFor(metricsRegistry, promhttp.HandlerOpts{Registry: metricsRegistry})) - go http.ListenAndServe(cfg.AI.Describer.MetricsListenAddress, nil) + go http.ListenAndServe(cfg.AI.Triage.MetricsListenAddress, nil) pCache := util.NewStringMapCache[string]("LLM prompt cache", time.Hour) llmMetrics := llm.CreateLLMMetrics(metricsRegistry) diff --git a/pkg/backend/config.go b/pkg/backend/config.go index ab9e69e..79dbca6 100644 --- a/pkg/backend/config.go +++ b/pkg/backend/config.go @@ -110,12 +110,12 @@ type Config struct { LLMCompletionTimeout time.Duration `fig:"llm_completion_timeout" default:"1m"` LLMConcurrentRequests int `fig:"llm_concurrent_requests" default:"5"` MaxInputCharacters int `fig:"max_input_characters" default:"4096"` - Describer struct { + Triage struct { Enable bool `fig:"enable"` - LogFile string `fig:"log_file" default:"describer.log" ` + LogFile string `fig:"log_file" default:"triage.log" ` LogLevel string `fig:"log_level" default:"debug" ` MetricsListenAddress string `fig:"metrics_listen_address" default:"localhost:8999" ` CacheExpirationTime time.Duration `fig:"cache_expiration_time" default:"8h"` - } `fig:"describer"` + } `fig:"triage"` } `fig:"ai"` }