Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/asankilp_marsho-cli.json
T

1 line
17 KiB
JSON

{"repo": "asankilp/marsho-cli", "files": {"src/configs/config.rs": {"ebb39e7b6ce9f15afda6e0c392a995fffef2e803": {"t": 1785746223.751224, "n": 1725, "h": "af6f1887af3bad3a", "c": "use serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n#[derive(Debug, Deserialize, Serialize, Clone)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_model_config() -> anyhow::Result<Value> {\n let config_path = \"model_config.yaml\";\n let config_str = serde_yaml::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let json_str = std::fs::read_to_string(config_path)?;\n serde_yaml::from_str(&json_str).map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let path = Path::new(config_path);\n\n if !path.exists() {\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n\n settings.try_deserialize().map_err(Into::into)\n}\n"}, "33585e86db9c920ad39d475f4b4c6e3947a96860": {"t": 1785760766.1306703, "n": 1725, "h": "af6f1887af3bad3a", "c": "use serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n#[derive(Debug, Deserialize, Serialize, Clone)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_model_config() -> anyhow::Result<Value> {\n let config_path = \"model_config.yaml\";\n let config_str = serde_yaml::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let json_str = std::fs::read_to_string(config_path)?;\n serde_yaml::from_str(&json_str).map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let path = Path::new(config_path);\n\n if !path.exists() {\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n\n settings.try_deserialize().map_err(Into::into)\n}\n"}, "e83dba784d2d0039c239e366b2c155ef23e67e9f": {"t": 1785760769.3650937, "n": 1721, "h": "0ce4dcb7f36a2503", "c": "use serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n#[derive(Debug, Deserialize, Serialize, Clone)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_model_config() -> anyhow::Result<Value> {\n let config_path = \"model_config.yaml\";\n let config_str = serde_yaml::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let json_str = std::fs::read_to_string(config_path)?;\n serde_yaml::from_str(&json_str).map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n\n settings.try_deserialize().map_err(Into::into)\n}\n"}, "7831a5d57e44f9c5fb24a05f3f51091f33d25151": {"t": 1785760770.6893342, "n": 1721, "h": "49917cccd81ed53d", "c": "use serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n#[derive(Debug, Deserialize, Serialize, Clone)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_model_config() -> anyhow::Result<Value> {\n let config_path = \"model_config.json\";\n let config_str = serde_json::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let json_str = std::fs::read_to_string(config_path)?;\n serde_json::from_str(&json_str).map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n\n settings.try_deserialize().map_err(Into::into)\n}\n"}, "226e43c6fc799f0e9b358ef49e69d4ede1e25616": {"t": 1785760771.8447804, "n": 1714, "h": "3b0a24413a89abc4", "c": "use serde::{Deserialize, Serialize};\nuse serde_json::Value;\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_model_config() -> anyhow::Result<Value> {\n let config_path = \"model_config.json\";\n let config_str = serde_json::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let json_str = std::fs::read_to_string(config_path)?;\n serde_json::from_str(&json_str).map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n\n settings.try_deserialize().map_err(Into::into)\n}\n"}, "e99414f30c4086b8615f4d8ab2d635428f79ab25": {"t": 1785760773.338381, "n": 1767, "h": "b123130057b5f8b8", "c": "use serde::{Deserialize, Serialize};\nuse std::path::Path;\n\n// pub enum ConfigType {\n// MarshoCfg,\n// ModelCfg,\n// }\n\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n pub system_prompt: String,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n system_prompt: String::from(\"你是一只可爱的猫娘,你的名字叫Marsho\"),\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\n\npub fn load_model_config() -> anyhow::Result<ModelConfig> {\n let config_path = \"model_config.yaml\";\n let config_str = serde_yaml::to_string(&ModelConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n"}, "04e78d639b262682432697fa1c1b1798c6f42468": {"t": 1785760774.7686758, "n": 1724, "h": "79ccf00936adc214", "c": "use serde::{Deserialize, Serialize};\nuse std::path::Path;\n\npub enum ConfigType {\n MarshoCfg,\n ModelCfg,\n}\n\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct MarshoConfig {\n pub base_url: String,\n pub api_key: String,\n pub stream: bool,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n pub model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\n\npub fn load_model_config() -> anyhow::Result<ModelConfig> {\n let config_path = \"model_config.yaml\";\n let config_str = serde_yaml::to_string(&ModelConfig::default())?;\n println!(\"{}\", config_path);\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n\npub fn load_marsho_config() -> anyhow::Result<MarshoConfig> {\n let config_path = \"config.yaml\";\n let config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n println!(\"{}\", config_path);\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n"}, "3cda3fe10ee978ab243b93dd185b53f545da07b7": {"t": 1785760776.3370547, "n": 1597, "h": "860460a14a030892", "c": "use serde::{Deserialize, Serialize};\nuse std::path::Path;\n\npub enum ConfigType {\n MarshoCfg,\n ModelCfg,\n}\n\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct MarshoConfig {\n base_url: String,\n api_key: String,\n stream: bool,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\n#[derive(Debug)]\npub enum Config {\n Marsho(MarshoConfig),\n Model(ModelConfig),\n}\n\npub fn load_config(r#type: ConfigType) -> anyhow::Result<config::Value> {\n let config_path: &str;\n let config_str: String;\n match r#type {\n ConfigType::MarshoCfg => {\n config_path = \"config.yaml\";\n config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n }\n ConfigType::ModelCfg => {\n config_path = \"model_config.yaml\";\n config_str = serde_yaml::to_string(&ModelConfig::default())?;\n }\n }\n println!(\"{}\", config_path);\n let path = Path::new(config_path);\n\n if !path.exists() {\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n"}, "5e436f08c3ab3249783b7ec9574bc4e41aa080b1": {"t": 1785760778.5872142, "n": 1624, "h": "f34d4360fb71dfcb", "c": "use serde::{Deserialize, Serialize};\nuse std::path::Path;\n\npub enum ConfigType {\n MarshoCfg,\n ModelCfg,\n}\n\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct MarshoConfig {\n base_url: String,\n api_key: String,\n stream: bool,\n}\n\nimpl Default for MarshoConfig {\n fn default() -> Self {\n Self {\n base_url: \"https://api.deepseek.com\".to_string(),\n api_key: \"\".to_string(),\n stream: true,\n }\n }\n}\n\n#[derive(Debug, Deserialize, Serialize)]\npub struct ModelConfig {\n model: String,\n}\n\nimpl Default for ModelConfig {\n fn default() -> Self {\n Self {\n model: \"deepseek-reasoner\".to_string(),\n }\n }\n}\n\npub fn load_config(r#type: ConfigType) -> anyhow::Result<()> {\n let config_path: &str;\n let config_str: String;\n match r#type {\n ConfigType::MarshoCfg => {\n config_path = \"config.yaml\";\n config_str = serde_yaml::to_string(&MarshoConfig::default())?;\n }\n ConfigType::ModelCfg => {\n config_path = \"model_config.yaml\";\n config_str = serde_yaml::to_string(&ModelConfig::default())?;\n }\n }\n println!(\"{}\", config_path);\n let path = Path::new(config_path);\n\n if !path.exists() {\n // let default_config = MarshoConfig::default();\n // let config_str = serde_yaml::to_string(&default_config)?;\n std::fs::write(config_path, config_str)?;\n }\n\n let settings = config::Config::builder()\n .add_source(config::File::with_name(config_path))\n .build()?;\n \n settings.try_deserialize().map_err(Into::into)\n}\n"}}}}