SanitizeModelConfigForLog Sanitize model configuration for log output. Takes the same ModelConfigUpdate type used by the request handler so the two can never drift out of sync.
(models map[string]ModelConfigUpdate)
| 19 | // Takes the same ModelConfigUpdate type used by the request handler so the two |
| 20 | // can never drift out of sync. |
| 21 | func SanitizeModelConfigForLog(models map[string]ModelConfigUpdate) map[string]interface{} { |
| 22 | safe := make(map[string]interface{}) |
| 23 | for modelID, cfg := range models { |
| 24 | safe[modelID] = map[string]interface{}{ |
| 25 | "enabled": cfg.Enabled, |
| 26 | "api_key": MaskSensitiveString(cfg.APIKey), |
| 27 | "custom_api_url": cfg.CustomAPIURL, |
| 28 | "custom_model_name": cfg.CustomModelName, |
| 29 | } |
| 30 | } |
| 31 | return safe |
| 32 | } |
| 33 | |
| 34 | // SanitizeExchangeConfigForLog Sanitize exchange configuration for log output. |
| 35 | // Takes the same ExchangeConfigUpdate type used by the request handler so every |