20 lines
474 B
Rust
20 lines
474 B
Rust
use std::path::Path;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub mod mcp;
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
pub struct Config {
|
|
pub mcp: mcp::McpConfig,
|
|
pub deepseek_key: Option<String>,
|
|
pub cohere_key: Option<String>,
|
|
}
|
|
|
|
impl Config {
|
|
pub async fn retrieve(path: impl AsRef<Path>) -> anyhow::Result<Self> {
|
|
let content = tokio::fs::read_to_string(path).await?;
|
|
let config: Self = toml::from_str(&content)?;
|
|
Ok(config)
|
|
}
|
|
}
|