fix panic in brightstaff (#485)

make router section optional in arch_config
This commit is contained in:
Adil Hafeez 2025-05-23 09:37:25 -07:00 committed by GitHub
parent 21faae605f
commit 99dd900a34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,7 +84,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
info!("listening on http://{}", bind_address); info!("listening on http://{}", bind_address);
let listener = TcpListener::bind(bind_address).await?; let listener = TcpListener::bind(bind_address).await?;
let model = arch_config.routing.as_ref().unwrap().model.clone(); let model = arch_config
.routing
.as_ref()
.and_then(|r| Some(r.model.clone()))
.unwrap_or_else(|| "none".to_string());
let router_service: Arc<RouterService> = Arc::new(RouterService::new( let router_service: Arc<RouterService> = Arc::new(RouterService::new(
arch_config.llm_providers.clone(), arch_config.llm_providers.clone(),