rust-sdk/examples/rig-integration/src/config.rs
4t145 0be6067326
Move whole rmcp crate to offcial rust sdk (#44)
* get rid of async-trait

* move rmcp to official-rust-sdk

* replace master with main

* update readme, change license

* fix typo

* Update README.md

Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>

* fix typos

---------

Co-authored-by: = <=>
Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>
2025-03-27 17:33:41 -04:00

20 lines
473 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 retrive(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)
}
}