rust-sdk/examples/rig-integration/src/config.rs
2025-04-02 01:15:01 +08:00

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)
}
}