fix: enable xAI (Grok) by default and improve provider visibility in dashboard
- Set Grok to enabled: true by default. - Updated AppState to include raw AppConfig. - Refactored dashboard to show all supported providers, including their configuration and initialization status (online, disabled, or error).
This commit is contained in:
29
src/lib.rs
29
src/lib.rs
@@ -71,7 +71,36 @@ pub mod test_utils {
|
||||
|
||||
let (dashboard_tx, _) = tokio::sync::broadcast::channel(100);
|
||||
|
||||
let config = Arc::new(crate::config::AppConfig {
|
||||
server: crate::config::ServerConfig {
|
||||
port: 8080,
|
||||
host: "127.0.0.1".to_string(),
|
||||
auth_tokens: vec![],
|
||||
},
|
||||
database: crate::config::DatabaseConfig {
|
||||
path: std::path::PathBuf::from(":memory:"),
|
||||
max_connections: 5,
|
||||
},
|
||||
providers: crate::config::ProviderConfig {
|
||||
openai: crate::config::OpenAIConfig { api_key_env: "OPENAI_API_KEY".to_string(), base_url: "".to_string(), default_model: "".to_string(), enabled: true },
|
||||
gemini: crate::config::GeminiConfig { api_key_env: "GEMINI_API_KEY".to_string(), base_url: "".to_string(), default_model: "".to_string(), enabled: true },
|
||||
deepseek: crate::config::DeepSeekConfig { api_key_env: "DEEPSEEK_API_KEY".to_string(), base_url: "".to_string(), default_model: "".to_string(), enabled: true },
|
||||
grok: crate::config::GrokConfig { api_key_env: "GROK_API_KEY".to_string(), base_url: "".to_string(), default_model: "".to_string(), enabled: true },
|
||||
ollama: crate::config::OllamaConfig { base_url: "".to_string(), enabled: true, models: vec![] },
|
||||
},
|
||||
model_mapping: crate::config::ModelMappingConfig { patterns: vec![] },
|
||||
pricing: crate::config::PricingConfig {
|
||||
openai: vec![],
|
||||
gemini: vec![],
|
||||
deepseek: vec![],
|
||||
grok: vec![],
|
||||
ollama: vec![],
|
||||
},
|
||||
config_path: None,
|
||||
});
|
||||
|
||||
Arc::new(AppState {
|
||||
config,
|
||||
provider_manager,
|
||||
db_pool: pool.clone(),
|
||||
rate_limit_manager: Arc::new(rate_limit_manager),
|
||||
|
||||
Reference in New Issue
Block a user