mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
fix: mongodb lazy initialization
This commit is contained in:
parent
cac2912ce6
commit
308f0d133a
1 changed files with 6 additions and 4 deletions
|
|
@ -420,12 +420,14 @@ class MongoDBVectorIOAdapter(OpenAIVectorStoreMixin, VectorIO, VectorStoresProto
|
||||||
if self.config.persistence:
|
if self.config.persistence:
|
||||||
self.kvstore = await kvstore_impl(self.config.persistence)
|
self.kvstore = await kvstore_impl(self.config.persistence)
|
||||||
|
|
||||||
# Validate connection string
|
# Skip MongoDB connection if no connection string provided
|
||||||
|
# This allows other providers to work without MongoDB credentials
|
||||||
if not self.config.connection_string:
|
if not self.config.connection_string:
|
||||||
raise ValueError(
|
logger.warning(
|
||||||
"MongoDB connection_string is required but not provided. "
|
"MongoDB connection_string not provided. "
|
||||||
"Please set MONGODB_CONNECTION_STRING environment variable or provide it in config."
|
"MongoDB vector store will not be available until credentials are configured."
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
||||||
# Connect to MongoDB with optimized settings for RAG
|
# Connect to MongoDB with optimized settings for RAG
|
||||||
self.client = MongoClient(
|
self.client = MongoClient(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue