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

Function real_client

core/tests/test_structured_json_real_llm.rs:49–72  ·  view source on GitHub ↗

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).

()

Source from the content-addressed store, hash-verified

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).
49fn 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.
75async fn gen_with_timeout(

Calls 5

expectMethod · 0.80
llm_configMethod · 0.80
default_llm_configMethod · 0.80
repo_config_pathFunction · 0.70

Tested by

no test coverage detected