2023-06-11 19:17:50 +05:00
|
|
|
use crate::config;
|
2025-12-11 23:43:50 +05:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-06-11 19:17:50 +05:00
|
|
|
|
|
|
|
|
use crate::config::structs::SpeechToTextEngine;
|
2025-12-11 23:43:50 +05:00
|
|
|
use crate::config::structs::WakeWordEngine;
|
2026-01-05 01:22:45 +05:00
|
|
|
use crate::config::structs::IntentRecognitionEngine;
|
2023-06-11 19:17:50 +05:00
|
|
|
|
2026-01-04 09:00:51 +05:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
2023-06-11 19:17:50 +05:00
|
|
|
pub struct Settings {
|
|
|
|
|
pub microphone: i32,
|
|
|
|
|
pub voice: String,
|
|
|
|
|
|
|
|
|
|
pub wake_word_engine: WakeWordEngine,
|
2026-01-05 01:22:45 +05:00
|
|
|
pub intent_recognition_engine: IntentRecognitionEngine,
|
2023-06-11 19:17:50 +05:00
|
|
|
pub speech_to_text_engine: SpeechToTextEngine,
|
|
|
|
|
|
2026-01-05 03:38:04 +05:00
|
|
|
pub vosk_model: String,
|
|
|
|
|
|
2025-12-11 23:43:50 +05:00
|
|
|
pub api_keys: ApiKeys,
|
2023-06-11 19:17:50 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for Settings {
|
|
|
|
|
fn default() -> Settings {
|
|
|
|
|
Settings {
|
|
|
|
|
microphone: -1,
|
|
|
|
|
voice: String::from(""),
|
|
|
|
|
|
|
|
|
|
wake_word_engine: config::DEFAULT_WAKE_WORD_ENGINE,
|
2026-01-05 01:22:45 +05:00
|
|
|
intent_recognition_engine: config::DEFAULT_INTENT_RECOGNITION_ENGINE,
|
2023-06-11 19:17:50 +05:00
|
|
|
speech_to_text_engine: config::DEFAULT_SPEECH_TO_TEXT_ENGINE,
|
|
|
|
|
|
2026-01-05 03:38:04 +05:00
|
|
|
vosk_model: String::from(""), // auto detect first available
|
|
|
|
|
|
2023-06-11 19:17:50 +05:00
|
|
|
api_keys: ApiKeys {
|
|
|
|
|
picovoice: String::from(""),
|
2025-12-11 23:43:50 +05:00
|
|
|
openai: String::from(""),
|
|
|
|
|
},
|
2023-06-11 19:17:50 +05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-04 09:00:51 +05:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
2023-06-11 19:17:50 +05:00
|
|
|
pub struct ApiKeys {
|
|
|
|
|
pub picovoice: String,
|
2025-12-11 23:43:50 +05:00
|
|
|
pub openai: String,
|
|
|
|
|
}
|