fix configuration errors of mongodb, neo4j, and qdrant backends.
This commit is contained in:
@@ -101,6 +101,7 @@ def estimate_tokens(text: str) -> int:
|
||||
|
||||
return int(tokens)
|
||||
|
||||
|
||||
def get_default_host(binding_type: str) -> str:
|
||||
default_hosts = {
|
||||
"ollama": os.getenv("LLM_BINDING_HOST", "http://localhost:11434"),
|
||||
|
@@ -44,7 +44,7 @@ class MongoKVStorage(BaseKVStorage):
|
||||
database = client.get_database(
|
||||
os.environ.get(
|
||||
"MONGO_DATABASE",
|
||||
mongo_database=config.get("mongodb", "database", fallback="LightRAG"),
|
||||
config.get("mongodb", "database", fallback="LightRAG"),
|
||||
)
|
||||
)
|
||||
self._data = database.get_collection(self.namespace)
|
||||
|
@@ -48,13 +48,13 @@ class Neo4JStorage(BaseGraphStorage):
|
||||
self._driver = None
|
||||
self._driver_lock = asyncio.Lock()
|
||||
|
||||
URI = os.environ["NEO4J_URI", config.get("neo4j", "uri", fallback=None)]
|
||||
USERNAME = os.environ[
|
||||
URI = os.environ.get("NEO4J_URI", config.get("neo4j", "uri", fallback=None))
|
||||
USERNAME = os.environ.get(
|
||||
"NEO4J_USERNAME", config.get("neo4j", "username", fallback=None)
|
||||
]
|
||||
PASSWORD = os.environ[
|
||||
)
|
||||
PASSWORD = os.environ.get(
|
||||
"NEO4J_PASSWORD", config.get("neo4j", "password", fallback=None)
|
||||
]
|
||||
)
|
||||
MAX_CONNECTION_POOL_SIZE = os.environ.get(
|
||||
"NEO4J_MAX_CONNECTION_POOL_SIZE",
|
||||
config.get("neo4j", "connection_pool_size", fallback=800),
|
||||
|
@@ -61,8 +61,8 @@ class QdrantVectorDBStorage(BaseVectorStorage):
|
||||
client.create_collection(collection_name, **kwargs)
|
||||
|
||||
def __post_init__(self):
|
||||
config = self.global_config.get("vector_db_storage_cls_kwargs", {})
|
||||
cosine_threshold = config.get("cosine_better_than_threshold")
|
||||
kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
|
||||
cosine_threshold = kwargs.get("cosine_better_than_threshold")
|
||||
if cosine_threshold is None:
|
||||
raise ValueError(
|
||||
"cosine_better_than_threshold must be specified in vector_db_storage_cls_kwargs"
|
||||
|
Reference in New Issue
Block a user