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

Method default_llm_config

core/src/config/loader.rs:434–453  ·  view source on GitHub ↗

Get LlmConfig for the default provider and model Returns None if default provider/model is not configured or API key is missing.

(&self)

Source from the content-addressed store, hash-verified

432 ///
433 /// Returns None if default provider/model is not configured or API key is missing.
434 pub fn default_llm_config(&self) -> Option<LlmConfig> {
435 let (provider, model) = self.default_model_config()?;
436 let api_key = provider.get_api_key(model)?;
437 let base_url = provider.get_base_url(model);
438 let headers = provider.get_headers(model);
439 let session_id_header = provider.get_session_id_header(model);
440
441 let mut config = LlmConfig::new(&provider.name, &model.id, api_key);
442 if let Some(url) = base_url {
443 config = config.with_base_url(url);
444 }
445 if !headers.is_empty() {
446 config = config.with_headers(headers);
447 }
448 if let Some(header_name) = session_id_header {
449 config = config.with_session_id_header(header_name);
450 }
451 config = apply_model_caps(config, model, self.thinking_budget);
452 Some(config)
453 }
454
455 /// Get LlmConfig for a specific provider and model
456 ///

Calls 10

apply_model_capsFunction · 0.85
default_model_configMethod · 0.80
get_api_keyMethod · 0.80
get_base_urlMethod · 0.80
get_headersMethod · 0.80
get_session_id_headerMethod · 0.80
with_base_urlMethod · 0.45
is_emptyMethod · 0.45
with_headersMethod · 0.45