From f9aa90f6127fff43318f1662a4cd416b51387c6d Mon Sep 17 00:00:00 2001 From: Preston Rasmussen <109292228+prasmussen15@users.noreply.github.com> Date: Wed, 2 Apr 2025 11:43:34 -0400 Subject: [PATCH] update rate limits (#316) * update rate limits * default none --- graphiti_core/llm_client/config.py | 2 +- .../utils/maintenance/graph_data_operations.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/graphiti_core/llm_client/config.py b/graphiti_core/llm_client/config.py index 952f6b52..8a4a35b6 100644 --- a/graphiti_core/llm_client/config.py +++ b/graphiti_core/llm_client/config.py @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. """ -DEFAULT_MAX_TOKENS = 2048 +DEFAULT_MAX_TOKENS = 8192 DEFAULT_TEMPERATURE = 0 diff --git a/graphiti_core/utils/maintenance/graph_data_operations.py b/graphiti_core/utils/maintenance/graph_data_operations.py index e9ceb94f..4f570b0d 100644 --- a/graphiti_core/utils/maintenance/graph_data_operations.py +++ b/graphiti_core/utils/maintenance/graph_data_operations.py @@ -92,13 +92,22 @@ async def build_indices_and_constraints(driver: AsyncDriver, delete_existing: bo ) -async def clear_data(driver: AsyncDriver): +async def clear_data(driver: AsyncDriver, group_ids: list[str] | None = None): async with driver.session() as session: async def delete_all(tx): await tx.run('MATCH (n) DETACH DELETE n') - await session.execute_write(delete_all) + async def delete_group_ids(tx): + await tx.run( + 'MATCH (n:Entity|Episodic|Community) WHERE n.group_id IN $group_ids DETACH DELETE n', + group_ids=group_ids, + ) + + if group_ids is None: + await session.execute_write(delete_all) + else: + await session.execute_write(delete_group_ids) async def retrieve_episodes(