18 lines
493 B
Rust
18 lines
493 B
Rust
use crate::AppConfig;
|
|
|
|
impl AppConfig {
|
|
pub fn qdrant_url(&self) -> anyhow::Result<String> {
|
|
if let Some(url) = self.env.get("APP_QDRANT_URL") {
|
|
return Ok(url.to_string());
|
|
}
|
|
Err(anyhow::anyhow!("APP_QDRANT_URL not found"))
|
|
}
|
|
|
|
pub fn qdrant_api_key(&self) -> anyhow::Result<Option<String>> {
|
|
if let Some(api_key) = self.env.get("APP_QDRANT_API_KEY") {
|
|
return Ok(Some(api_key.to_string()));
|
|
}
|
|
Ok(None)
|
|
}
|
|
}
|