Skip to content

Commit

Permalink
Rename describer to triage in config
Browse files Browse the repository at this point in the history
  • Loading branch information
niels committed Dec 13, 2024
1 parent 6d0ffaa commit 1323866
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cmd/backend/backend_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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)
}
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/triage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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":
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/backend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 1323866

Please sign in to comment.