Merge pull request #421 from topoteretes/add-set-graph-database

feat: Add ability to change graph database configuration through cognee
This commit is contained in:
Igor Ilic 2025-01-09 17:18:37 +01:00 committed by GitHub
commit 64e803b92b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,6 +131,18 @@ class config:
message=f"'{key}' is not a valid attribute of the config."
)
@staticmethod
def set_graph_db_config(config_dict: dict) -> None:
"""
Updates the graph db config with values from config_dict.
"""
graph_db_config = get_graph_config()
for key, value in config_dict.items():
if hasattr(graph_db_config, key):
object.__setattr__(graph_db_config, key, value)
else:
raise AttributeError(message=f"'{key}' is not a valid attribute of the config.")
@staticmethod
def set_vector_db_config(config_dict: dict):
"""