feat: Add ability to change graph database configuration through cognee

This commit is contained in:
Igor Ilic 2025-01-09 16:41:18 +01:00
parent c5e15d715a
commit 6b57bfc4cb

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):
"""