Skip to content

Commit

Permalink
Merge pull request #421 from topoteretes/add-set-graph-database
Browse files Browse the repository at this point in the history
feat: Add ability to change graph database configuration through cognee
  • Loading branch information
dexters1 authored Jan 9, 2025
2 parents c5e15d7 + 6b57bfc commit 64e803b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cognee/api/v1/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ def set_relational_db_config(config_dict: dict):
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):
"""
Expand Down

0 comments on commit 64e803b

Please sign in to comment.