()
| 1188 | // ======================================================================== |
| 1189 | |
| 1190 | fn load_minimax_config() -> Option<(String, String, String)> { |
| 1191 | // CARGO_MANIFEST_DIR = .../crates/code/core |
| 1192 | // config.acl is at repo root: .../a3s/.a3s/config.acl |
| 1193 | let manifest_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); |
| 1194 | let candidates = [ |
| 1195 | manifest_dir.join("../../../.a3s/config.acl"), // crates/code/core → repo root |
| 1196 | manifest_dir.join("../../.a3s/config.acl"), |
| 1197 | manifest_dir.join("../.a3s/config.acl"), |
| 1198 | ]; |
| 1199 | |
| 1200 | let config_path = candidates.iter().find(|p| p.exists())?; |
| 1201 | let content = std::fs::read_to_string(config_path).ok()?; |
| 1202 | |
| 1203 | // Parse ACL to extract openai provider with MiniMax model |
| 1204 | let api_key = extract_acl_field(&content, "providers \"openai\"", "apiKey")?; |
| 1205 | let base_url = extract_acl_field(&content, "providers \"openai\"", "baseUrl")?; |
| 1206 | Some((base_url, api_key, "MiniMax-M2.7-highspeed".to_string())) |
| 1207 | } |
| 1208 | |
| 1209 | fn extract_acl_field(content: &str, section: &str, field: &str) -> Option<String> { |
| 1210 | let section_start = content.find(section)?; |
no test coverage detected