1use anyhow::Result;
4
5pub mod definitions;
7
8pub mod aliases;
10pub mod audio;
11pub mod chat;
12pub mod completion;
13pub mod config;
14pub mod embed;
15pub mod image;
16pub mod keys;
17pub mod logging;
18pub mod mcp;
19pub mod models;
20pub mod prompts;
21pub mod providers;
22pub mod proxy;
23pub mod search;
24pub mod sync;
25pub mod templates;
26pub mod usage;
27pub mod utils;
28pub mod vectors;
29pub mod webchatproxy;
30
31pub use definitions::*;
33
34pub fn set_debug_mode(enabled: bool) {
36 crate::DEBUG_MODE.store(enabled, std::sync::atomic::Ordering::Relaxed);
37}
38
39#[allow(dead_code)]
41pub fn parse_env_var(s: &str) -> Result<(String, String), String> {
42 let parts: Vec<&str> = s.splitn(2, '=').collect();
43 if parts.len() != 2 {
44 return Err(format!(
45 "Invalid environment variable format: '{}'. Expected 'KEY=VALUE'",
46 s
47 ));
48 }
49 Ok((parts[0].to_string(), parts[1].to_string()))
50}