Build a client from `.a3s/config.acl`. By default uses the config's `default_model`; set `A3S_TEST_MODEL=provider/model` to target a specific model (e.g. a tool-capable one for structured-output tests).
()
| 47 | /// `default_model`; set `A3S_TEST_MODEL=provider/model` to target a specific |
| 48 | /// model (e.g. a tool-capable one for structured-output tests). |
| 49 | fn real_client() -> Arc<dyn LlmClient> { |
| 50 | let path = repo_config_path(); |
| 51 | let config = CodeConfig::from_file(&path) |
| 52 | .unwrap_or_else(|e| panic!("failed to load {}: {e}", path.display())); |
| 53 | |
| 54 | let llm_config = match std::env::var("A3S_TEST_MODEL") { |
| 55 | Ok(spec) => { |
| 56 | let (provider, model) = spec |
| 57 | .split_once('/') |
| 58 | .expect("A3S_TEST_MODEL must be 'provider/model'"); |
| 59 | eprintln!("[real-llm] model = {spec} (from {})", path.display()); |
| 60 | config |
| 61 | .llm_config(provider, model) |
| 62 | .unwrap_or_else(|| panic!("model {spec} not found in {}", path.display())) |
| 63 | } |
| 64 | Err(_) => { |
| 65 | eprintln!("[real-llm] model = <default> (from {})", path.display()); |
| 66 | config |
| 67 | .default_llm_config() |
| 68 | .expect("default llm config in .a3s/config.acl") |
| 69 | } |
| 70 | }; |
| 71 | create_client_with_config(llm_config) |
| 72 | } |
| 73 | |
| 74 | /// Run a structured generation with a hard timeout. |
| 75 | async fn gen_with_timeout( |
no test coverage detected