MCPcopy Create free account
hub / github.com/AI45Lab/Code / load_minimax_config

Function load_minimax_config

core/src/llm/structured_tests.rs:1190–1207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1188// ========================================================================
1189
1190fn 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
1209fn extract_acl_field(content: &str, section: &str, field: &str) -> Option<String> {
1210 let section_start = content.find(section)?;

Calls 2

extract_acl_fieldFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected