Add Whisper user settings to config

Introduce a new struct `WhisperUserSettings` to hold per-user
transcription settings. This allows users to customize Whisper
transcription for their specific needs directly in the `users.toml`
configuration file.

The changes include:
- Defining `WhisperUserSettings` with optional fields for `language`,
  `hotwords`, and `initial_prompt`.
- Integrating `WhisperUserSettings` into the `User` struct, with
  `#[serde(default)]` to ensure it defaults to
  `WhisperUserSettings::default()` if not present in the TOML.
- Adding new unit tests to verify that users can be parsed correctly
  with and without a `[user.whisper]` block.
- Updating existing tests in `auth_test.rs`, `upload_test.rs`, and
  `web_test.rs` to include the new `whisper` field, ensuring backward
  compatibility.
This commit is contained in:
2026-04-14 11:00:52 +02:00
parent c3d5e2b0ad
commit 0ef9109876
4 changed files with 64 additions and 0 deletions
+1
View File
@@ -19,6 +19,7 @@ fn test_config() -> Arc<Config> {
api_key: "test-key-123".into(),
web_password: "unused".into(),
role: "doctor".into(),
whisper: Default::default(),
}],
api_keys: HashMap::from([("test-key-123".into(), "dr_test".into())]),
retention_audio_days: 30,
+1
View File
@@ -24,6 +24,7 @@ fn test_config() -> Arc<Config> {
api_key: "test-key-123".into(),
web_password: "unused".into(),
role: "doctor".into(),
whisper: Default::default(),
}],
api_keys: HashMap::from([("test-key-123".into(), "dr_test".into())]),
retention_audio_days: 30,
+1
View File
@@ -24,6 +24,7 @@ fn test_config() -> Arc<Config> {
api_key: "test-key".into(),
web_password: "unused".into(),
role: "doctor".into(),
whisper: Default::default(),
}],
api_keys: HashMap::from([("test-key".into(), "dr_test".into())]),
retention_audio_days: 30,