fix: use Vault config for Qdrant in KB indexer
- website_crawler_service: use QdrantConfig::from_config instead of default - local_file_monitor: use QdrantConfig::from_config with DbPool - kb_indexer: KbFolderMonitor now uses SecretsManager for Qdrant config This fixes the issue where Qdrant URL was hardcoded to localhost:6333 instead of reading from Vault (gbo/vectordb).
This commit is contained in:
parent
f526fa1daa
commit
8dddc916ff
3 changed files with 17 additions and 8 deletions
|
|
@ -747,7 +747,16 @@ pub struct KbFolderMonitor {
|
|||
|
||||
impl KbFolderMonitor {
|
||||
pub fn new(work_root: PathBuf, embedding_config: EmbeddingConfig) -> Self {
|
||||
let qdrant_config = QdrantConfig::default();
|
||||
let qdrant_config = if let Some(sm) = crate::core::shared::utils::get_secrets_manager_sync() {
|
||||
let (url, api_key) = sm.get_vectordb_config_sync();
|
||||
QdrantConfig {
|
||||
url,
|
||||
api_key,
|
||||
timeout_secs: 30,
|
||||
}
|
||||
} else {
|
||||
QdrantConfig::default()
|
||||
};
|
||||
let indexer = KbIndexer::new(embedding_config, qdrant_config);
|
||||
|
||||
Self { indexer, work_root }
|
||||
|
|
|
|||
|
|
@ -241,9 +241,9 @@ impl WebsiteCrawlerService {
|
|||
let embedding_config = embedding_config_with_vault(&db_pool, &website.bot_id, &bot_name).await;
|
||||
info!("Using embedding URL: {} for bot {}", embedding_config.embedding_url, bot_name);
|
||||
|
||||
// Create bot-specific KB indexer with correct embedding config
|
||||
let qdrant_config = QdrantConfig::default();
|
||||
let bot_indexer = KbIndexer::new(embedding_config, qdrant_config);
|
||||
// Create bot-specific KB indexer with correct embedding config
|
||||
let qdrant_config = QdrantConfig::from_config(db_pool.clone(), &website.bot_id);
|
||||
let bot_indexer = KbIndexer::new(embedding_config, qdrant_config);
|
||||
|
||||
// Process pages in small batches to prevent memory exhaustion
|
||||
const BATCH_SIZE: usize = 5;
|
||||
|
|
|
|||
|
|
@ -291,11 +291,11 @@ impl LocalFileMonitor {
|
|||
continue;
|
||||
}
|
||||
|
||||
info!("Indexing KB '{}' for bot '{}'", kb_name, bot_name);
|
||||
info!("Indexing KB '{}' for bot '{}'", kb_name, bot_name);
|
||||
|
||||
// Create a temporary KbIndexer with the bot-specific config
|
||||
let qdrant_config = crate::core::kb::QdrantConfig::default();
|
||||
let indexer = crate::core::kb::KbIndexer::new(embedding_config.clone(), qdrant_config);
|
||||
// Create a temporary KbIndexer with the bot-specific config
|
||||
let qdrant_config = crate::core::kb::QdrantConfig::from_config(self.state.conn.clone(), &bot_id);
|
||||
let indexer = crate::core::kb::KbIndexer::new(embedding_config.clone(), qdrant_config);
|
||||
|
||||
if let Err(e) = indexer.index_kb_folder(
|
||||
bot_id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue