1 line
9.8 KiB
JSON
1 line
9.8 KiB
JSON
{"repo": "chi-kai/charon", "files": {"src/types.rs": {"566929918e7101b0f6fe3634fef242e9d8e6cbf8": {"t": 1785746227.1650536, "n": 1834, "h": "3dc9622037218122", "c": "use serde::Deserialize;\nuse std::collections::HashMap;\n\n#[derive(Deserialize, Debug)]\npub struct RouterConfig {\n pub server: ServerConfig,\n pub routes: HashMap<String, RouteConfig>,\n #[serde(default)]\n pub mods: Vec<ModConfig>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ServerConfig {\n pub host: String,\n pub port: u16,\n}\n\n#[derive(Deserialize, Debug)]\npub struct RouteConfig {\n pub route: String,\n #[serde(rename = \"type\")]\n pub api_type: ApiType,\n pub apikey: String,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ModConfig {\n pub name: String,\n pub config: HashMap<String, String>,\n}\n\n#[derive(Deserialize, Debug, Clone, PartialEq)]\n#[serde(rename_all = \"lowercase\")]\npub enum ApiType {\n Qwen,\n DeepSeek,\n Other,\n}\n\nimpl ApiType {\n pub fn get_config(&self) -> ApiTypeConfig {\n match self {\n ApiType::Qwen => ApiTypeConfig {\n sni: \"dashscope.aliyuncs.com\".to_string(),\n apiurl: \"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions\"\n .to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::DeepSeek => ApiTypeConfig {\n sni: \"api.deepseek.com\".to_string(),\n apiurl: \"https://api.deepseek.com/chat/completions\".to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::Other => ApiTypeConfig {\n sni: \"\".to_string(),\n apiurl: \"\".to_string(),\n port: 0,\n extra_headers: HashMap::new(),\n },\n }\n }\n}\n\n#[derive(Debug, Clone)]\npub struct ApiTypeConfig {\n pub sni: String,\n pub apiurl: String,\n pub port: u16,\n pub extra_headers: HashMap<String, String>,\n}\n"}, "94e5eb2e8216a74a3f642b2a938db7e347f327a2": {"t": 1785760805.4040225, "n": 1834, "h": "3dc9622037218122", "c": "use serde::Deserialize;\nuse std::collections::HashMap;\n\n#[derive(Deserialize, Debug)]\npub struct RouterConfig {\n pub server: ServerConfig,\n pub routes: HashMap<String, RouteConfig>,\n #[serde(default)]\n pub mods: Vec<ModConfig>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ServerConfig {\n pub host: String,\n pub port: u16,\n}\n\n#[derive(Deserialize, Debug)]\npub struct RouteConfig {\n pub route: String,\n #[serde(rename = \"type\")]\n pub api_type: ApiType,\n pub apikey: String,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ModConfig {\n pub name: String,\n pub config: HashMap<String, String>,\n}\n\n#[derive(Deserialize, Debug, Clone, PartialEq)]\n#[serde(rename_all = \"lowercase\")]\npub enum ApiType {\n Qwen,\n DeepSeek,\n Other,\n}\n\nimpl ApiType {\n pub fn get_config(&self) -> ApiTypeConfig {\n match self {\n ApiType::Qwen => ApiTypeConfig {\n sni: \"dashscope.aliyuncs.com\".to_string(),\n apiurl: \"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions\"\n .to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::DeepSeek => ApiTypeConfig {\n sni: \"api.deepseek.com\".to_string(),\n apiurl: \"https://api.deepseek.com/chat/completions\".to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::Other => ApiTypeConfig {\n sni: \"\".to_string(),\n apiurl: \"\".to_string(),\n port: 0,\n extra_headers: HashMap::new(),\n },\n }\n }\n}\n\n#[derive(Debug, Clone)]\npub struct ApiTypeConfig {\n pub sni: String,\n pub apiurl: String,\n pub port: u16,\n pub extra_headers: HashMap<String, String>,\n}\n"}, "57926a2f3347051795270e6d22898b5da0ba171e": {"t": 1785760806.5423908, "n": 1846, "h": "5d0c857723bfb6f4", "c": "use serde::Deserialize;\nuse std::collections::HashMap;\n\n#[derive(Deserialize, Debug)]\npub struct RouterConfig {\n pub server: ServerConfig,\n pub routes: HashMap<String, RouteConfig>,\n #[serde(default)]\n pub mods: HashMap<String, ModConfig>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ServerConfig {\n pub host: String,\n pub port: u16,\n}\n\n#[derive(Deserialize, Debug)]\npub struct RouteConfig {\n pub route: String,\n #[serde(rename = \"type\")]\n pub api_type: ApiType,\n pub apikey: String,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ModConfig {\n pub name: String,\n pub config: HashMap<String, String>,\n}\n\n#[derive(Deserialize, Debug, Clone, PartialEq)]\n#[serde(rename_all = \"lowercase\")]\npub enum ApiType {\n Qwen,\n DeepSeek,\n Other,\n}\n\nimpl ApiType {\n pub fn get_config(&self) -> ApiTypeConfig {\n match self {\n ApiType::Qwen => ApiTypeConfig {\n sni: \"dashscope.aliyuncs.com\".to_string(),\n apiurl: \"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions\"\n .to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::DeepSeek => ApiTypeConfig {\n sni: \"api.deepseek.com\".to_string(),\n apiurl: \"https://api.deepseek.com/chat/completions\".to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::Other => ApiTypeConfig {\n sni: \"\".to_string(),\n apiurl: \"\".to_string(),\n port: 0,\n extra_headers: HashMap::new(),\n },\n }\n }\n}\n\n#[derive(Debug, Clone)]\npub struct ApiTypeConfig {\n pub sni: String,\n pub apiurl: String,\n pub port: u16,\n pub extra_headers: HashMap<String, String>,\n}\n"}, "b6dbf9fea34e8f70171d7914db2ef29704873614": {"t": 1785760807.7992365, "n": 1663, "h": "046c8018b0630c66", "c": "use serde::Deserialize;\nuse std::collections::HashMap;\n\n#[derive(Deserialize, Debug)]\npub struct RouterConfig {\n pub server: ServerConfig,\n pub routes: HashMap<String, RouteConfig>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct ServerConfig {\n pub host: String,\n pub port: u16,\n}\n\n#[derive(Deserialize, Debug)]\npub struct RouteConfig {\n pub route: String,\n #[serde(rename = \"type\")]\n pub api_type: ApiType,\n pub apikey: String,\n}\n\n#[derive(Deserialize, Debug, Clone, PartialEq)]\n#[serde(rename_all = \"lowercase\")]\npub enum ApiType {\n Qwen,\n DeepSeek,\n Other,\n}\n\nimpl ApiType {\n pub fn get_config(&self) -> ApiTypeConfig {\n match self {\n ApiType::Qwen => ApiTypeConfig {\n sni: \"dashscope.aliyuncs.com\".to_string(),\n apiurl: \"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions\"\n .to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::DeepSeek => ApiTypeConfig {\n sni: \"api.deepseek.com\".to_string(),\n apiurl: \"https://api.deepseek.com/chat/completions\".to_string(),\n port: 443,\n extra_headers: HashMap::new(),\n },\n ApiType::Other => ApiTypeConfig {\n sni: \"\".to_string(),\n apiurl: \"\".to_string(),\n port: 0,\n extra_headers: HashMap::new(),\n },\n }\n }\n}\n\n#[derive(Debug, Clone)]\npub struct ApiTypeConfig {\n pub sni: String,\n pub apiurl: String,\n pub port: u16,\n pub extra_headers: HashMap<String, String>,\n}\n"}, "7a4fdea20913da4a3a6165143f3cedbc6edfba50": {"t": 1785760809.1003642, "n": 293, "h": "de9c786bfdbd7507", "c": "use serde::Deserialize;\nuse std::collections::HashMap;\n\n#[derive(Deserialize, Debug)]\npub struct RouterConfig {\n pub routes: HashMap<String, RouteConfig>,\n}\n\n#[derive(Deserialize, Debug)]\npub struct RouteConfig {\n pub apiurl: String,\n pub port: u16,\n pub apikey: Option<String>,\n}\n"}}, "config.yaml": {"566929918e7101b0f6fe3634fef242e9d8e6cbf8": {"t": 1785746814.642891, "n": 558, "h": "6697e58bff65c85b", "c": "server:\n host: \"0.0.0.0\" # 监听地址\n port: 6193 # 监听端口\n\nroutes:\n pr1:\n route: \"/chat\"\n type: \"qwen\"\n apikey: \"sk-\"\n\n pr2:\n route: \"/write\" # 路由路径\n type: \"deepseek\" # 请求类型\n apikey: \"sk-\" # API 密钥\n\nmods:\n - name: \"cache\"\n config:\n memory_cache_size: \"1000\"\n redis_ttl: \"3600\"\n similarity_threshold: \"0.95\"\n embedding_key: \"sk-\"\n db_type: \"milvus\"\n redis_url: \"redis://localhost:6379\"\n vector_db_url: \"http://localhost:19530\"\n vector_db_collection_name: \"test\"\n vector_db_metric_type: \"COSINE\"\n"}, "94e5eb2e8216a74a3f642b2a938db7e347f327a2": {"t": 1785760808.0291398, "n": 558, "h": "6697e58bff65c85b", "c": "server:\n host: \"0.0.0.0\" # 监听地址\n port: 6193 # 监听端口\n\nroutes:\n pr1:\n route: \"/chat\"\n type: \"qwen\"\n apikey: \"sk-\"\n\n pr2:\n route: \"/write\" # 路由路径\n type: \"deepseek\" # 请求类型\n apikey: \"sk-\" # API 密钥\n\nmods:\n - name: \"cache\"\n config:\n memory_cache_size: \"1000\"\n redis_ttl: \"3600\"\n similarity_threshold: \"0.95\"\n embedding_key: \"sk-\"\n db_type: \"milvus\"\n redis_url: \"redis://localhost:6379\"\n vector_db_url: \"http://localhost:19530\"\n vector_db_collection_name: \"test\"\n vector_db_metric_type: \"COSINE\"\n"}}}} |