use crate::config::AppConfig; use crate::error::AppResult; impl AppConfig { pub fn qdrant_url(&self) -> AppResult> { self.get_env::("APP_QDRANT_URL") } pub fn qdrant_cluster_nodes(&self) -> AppResult> { match self.get_env::("APP_QDRANT_CLUSTER_NODES")? { Some(s) if !s.is_empty() => Ok(s .split(',') .map(|u| u.trim().to_string()) .filter(|u| !u.is_empty()) .collect()), _ => Ok(Vec::new()), } } pub fn qdrant_api_key(&self) -> AppResult> { self.get_env::("APP_QDRANT_API_KEY") } pub fn qdrant_collection(&self) -> AppResult> { self.get_env::("APP_QDRANT_COLLECTION") } pub fn qdrant_vector_size(&self) -> AppResult { self.get_env_or("APP_QDRANT_VECTOR_SIZE", 1536) } pub fn qdrant_distance(&self) -> AppResult { self.get_env_or("APP_QDRANT_DISTANCE", "Cosine".to_string()) } pub fn qdrant_max_connections(&self) -> AppResult { self.get_env_or("APP_QDRANT_MAX_CONNECTIONS", 10) } pub fn qdrant_idle_timeout(&self) -> AppResult { self.get_env_or("APP_QDRANT_IDLE_TIMEOUT", 300) } pub fn qdrant_connection_timeout(&self) -> AppResult { self.get_env_or("APP_QDRANT_CONNECTION_TIMEOUT", 10) } pub fn qdrant_max_retries(&self) -> AppResult { self.get_env_or("APP_QDRANT_MAX_RETRIES", 3) } pub fn qdrant_tls_enabled(&self) -> AppResult { self.get_env_or("APP_QDRANT_TLS_ENABLED", true) } pub fn qdrant_search_limit(&self) -> AppResult { self.get_env_or("APP_QDRANT_SEARCH_LIMIT", 10) } pub fn qdrant_score_threshold(&self) -> AppResult { self.get_env_or("APP_QDRANT_SCORE_THRESHOLD", 0.7) } }