feat: init

This commit is contained in:
zhenyi
2026-06-07 11:30:56 +08:00
commit 563381c1ca
361 changed files with 41327 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
use crate::config::AppConfig;
use crate::error::AppResult;
impl AppConfig {
pub fn embed_ai_provider_api_key(&self) -> AppResult<Option<String>> {
self.get_env::<String>("APP_EMBED_AI_PROVIDER_API_KEY")
}
pub fn embed_ai_provider_url(&self) -> AppResult<Option<String>> {
self.get_env::<String>("APP_EMBED_AI_PROVIDER_URL")
}
pub fn embed_ai_provider_model(&self) -> AppResult<String> {
self.get_env_or(
"APP_EMBED_AI_PROVIDER_MODEL",
"text-embedding-3-small".to_string(),
)
}
pub fn embed_ai_provider_dimensions(&self) -> AppResult<u32> {
self.get_env_or("APP_EMBED_AI_PROVIDER_DIMENSIONS", 1536)
}
pub fn embed_ai_provider_timeout(&self) -> AppResult<u64> {
self.get_env_or("APP_EMBED_AI_PROVIDER_TIMEOUT", 30)
}
}