Skip to content

Commit

Permalink
feat: Add ability to change graph database configuration through cognee
Browse files Browse the repository at this point in the history
  • Loading branch information
dexters1 committed Jan 9, 2025
1 parent c5e15d7 commit 6b57bfc
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 6b57bfc

Please sign in to comment.