refactor: Remove unused env parameter

Remove VECTOR_DB_NAME env parameter as it's not needed

Refactor #COG-170
This commit is contained in:
Igor Ilic 2024-10-17 17:13:40 +02:00
parent 9fbf2d857f
commit 9b9ae6c8aa
3 changed files with 10 additions and 15 deletions

View file

@ -7,26 +7,26 @@ GRAPHISTRY_PASSWORD=
SENTRY_REPORTING_URL=
GRAPH_DATABASE_PROVIDER="neo4j" # "neo4j" or "networkx"
# "neo4j" or "networkx"
GRAPH_DATABASE_PROVIDER="neo4j"
# Not needed if using networkx
GRAPH_DATABASE_URL=
GRAPH_DATABASE_USERNAME=
GRAPH_DATABASE_PASSWORD=
VECTOR_ENGINE_PROVIDER="qdrant" # or "qdrant", "pgvector", "weaviate" or "lancedb"
# "qdrant", "pgvector", "weaviate" or "lancedb"
VECTOR_ENGINE_PROVIDER="qdrant"
# Not needed if using "lancedb" or "pgvector"
VECTOR_DB_URL=
VECTOR_DB_KEY=
# Needed if using "pgvector"
VECTOR_DB_NAME=
# Relational Database provider
DB_PROVIDER="sqlite" # "sqlite" or "postgres"
# Relational Database provider "sqlite" or "postgres"
DB_PROVIDER="sqlite"
# Relational Database name
# Database name
DB_NAME=cognee_db
# Postgres specific parameters (Only if Postgres or PGVector is run)
# Postgres specific parameters (Only if Postgres or PGVector is used)
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USERNAME=cognee

View file

@ -10,7 +10,6 @@ class VectorConfig(BaseSettings):
)
vector_db_key: str = ""
vector_engine_provider: str = "lancedb"
vector_db_name: str = "cognee_vector_db"
model_config = SettingsConfigDict(env_file = ".env", extra = "allow")
@ -19,7 +18,6 @@ class VectorConfig(BaseSettings):
"vector_db_url": self.vector_db_url,
"vector_db_key": self.vector_db_key,
"vector_db_provider": self.vector_engine_provider,
"vector_db_name": self.vector_db_name,
}
@lru_cache

View file

@ -6,7 +6,6 @@ class VectorConfig(Dict):
vector_db_url: str
vector_db_key: str
vector_db_provider: str
vector_db_name: str
def create_vector_engine(config: VectorConfig, embedding_engine):
if config["vector_db_provider"] == "weaviate":
@ -38,10 +37,8 @@ def create_vector_engine(config: VectorConfig, embedding_engine):
db_password = relational_config.db_password
db_host = relational_config.db_host
db_port = relational_config.db_port
# Get name of vector database
db_name = config["vector_db_name"]
db_name = relational_config.db_name
connection_string: str = f"postgresql+asyncpg://{db_username}:{db_password}@{db_host}:{db_port}/{db_name}"
return PGVectorAdapter(connection_string,