Add config loading primitives
This commit is contained in:
14
internal/core/config/redaction.go
Normal file
14
internal/core/config/redaction.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package config
|
||||
|
||||
const redactedSecret = "[REDACTED]"
|
||||
|
||||
func (c Config) Redacted() Config {
|
||||
redacted := cloneConfig(c)
|
||||
for id, profile := range redacted.LLMProfiles {
|
||||
if profile.APIKey != "" {
|
||||
profile.APIKey = redactedSecret
|
||||
}
|
||||
redacted.LLMProfiles[id] = profile
|
||||
}
|
||||
return redacted
|
||||
}
|
||||
Reference in New Issue
Block a user