Redact the API Key when patching chat workspace settings

This commit is contained in:
Kerollmops 2025-06-10 09:21:45 +02:00
parent 48e8356a16
commit a7f5d3bb7a
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -103,7 +103,7 @@ async fn patch_settings(
Setting::NotSet => old_settings.prompts, Setting::NotSet => old_settings.prompts,
}; };
let settings = ChatCompletionSettings { let mut settings = ChatCompletionSettings {
source: match new.source { source: match new.source {
Setting::Set(new_source) => new_source.into(), Setting::Set(new_source) => new_source.into(),
Setting::Reset => DbChatCompletionSource::default(), Setting::Reset => DbChatCompletionSource::default(),
@ -154,6 +154,8 @@ async fn patch_settings(
index_scheduler.put_chat_settings(&mut wtxn, &workspace_uid, &settings)?; index_scheduler.put_chat_settings(&mut wtxn, &workspace_uid, &settings)?;
wtxn.commit()?; wtxn.commit()?;
settings.hide_secrets();
Ok(HttpResponse::Ok().json(settings)) Ok(HttpResponse::Ok().json(settings))
} }