MCPcopy Create free account
hub / github.com/GCWing/BitFun / set_default_model

Function set_default_model

src/apps/cli/src/management.rs:161–176  ·  view source on GitHub ↗
(model_id: &str)

Source from the content-addressed store, hash-verified

159}
160
161pub async fn set_default_model(model_id: &str) -> Result<()> {
162 let config_service = ensure_global_config_service().await?;
163 let agent_registry = get_agent_registry();
164 let modes = agent_registry.get_modes_info().await;
165
166 config_service
167 .set_config("ai.default_models.primary", model_id)
168 .await?;
169 for mode in modes {
170 let path = format!("ai.agent_models.{}", mode.id);
171 config_service.set_config(&path, model_id).await?;
172 }
173
174 println!("Default model set to: {}", model_id);
175 Ok(())
176}
177
178pub async fn set_mcp_server_enabled(server_id: &str, enabled: bool) -> Result<()> {
179 let config_service = ensure_global_config_service().await?;

Callers 1

run_cliFunction · 0.85

Calls 4

get_agent_registryFunction · 0.85
get_modes_infoMethod · 0.80
set_configMethod · 0.80

Tested by

no test coverage detected