feat: add test_load and test_parse binaries for configuration loading and parsing
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
use zesdex_domain::cms::AppConfigRepository;
|
||||
use zesdex_infrastructure::persistence::cms::app_config_repo::JsonAppConfigRepository;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let base_dir = dirs::home_dir().unwrap().join(".local/share/zesdex");
|
||||
let repo = JsonAppConfigRepository::new();
|
||||
let config = repo.load(&base_dir).unwrap();
|
||||
|
||||
println!("Providers:");
|
||||
for (k, v) in &config.providers {
|
||||
println!(" - {} (default model: {:?})", k, v.default_model);
|
||||
}
|
||||
|
||||
println!("Default provider: {}", config.default_provider);
|
||||
println!("Default model: {}", config.default_model);
|
||||
println!("Model roles:");
|
||||
for (k, v) in &config.model_roles {
|
||||
println!(" - {}: provider={}, model={}", k, v.provider, v.model);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user