graphiti-core 0.11.6rc4__py3-none-any.whl → 0.11.6rc6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
graphiti_core/helpers.py CHANGED
@@ -18,6 +18,7 @@ import asyncio
18
18
  import os
19
19
  from collections.abc import Coroutine
20
20
  from datetime import datetime
21
+ from typing import Any
21
22
 
22
23
  import numpy as np
23
24
  from dotenv import load_dotenv
@@ -91,11 +92,27 @@ def normalize_l2(embedding: list[float]):
91
92
 
92
93
 
93
94
  # Use this instead of asyncio.gather() to bound coroutines
94
- async def semaphore_gather(*coroutines: Coroutine, max_coroutines: int = SEMAPHORE_LIMIT):
95
+ async def semaphore_gather(
96
+ *coroutines: Coroutine,
97
+ max_coroutines: int = SEMAPHORE_LIMIT,
98
+ ):
95
99
  semaphore = asyncio.Semaphore(max_coroutines)
96
100
 
97
- async def _wrap_coroutine(coroutine):
101
+ async def _wrap(coro: Coroutine) -> Any:
98
102
  async with semaphore:
99
- return await coroutine
100
-
101
- return await asyncio.gather(*(_wrap_coroutine(coroutine) for coroutine in coroutines))
103
+ return await coro
104
+
105
+ results = []
106
+ batch = []
107
+ for coroutine in coroutines:
108
+ batch.append(_wrap(coroutine))
109
+ # once we hit max_coroutines, gather and clear the batch
110
+ if len(batch) >= max_coroutines:
111
+ results.extend(await asyncio.gather(*batch))
112
+ batch.clear()
113
+
114
+ # gather any remaining coroutines in the final batch
115
+ if batch:
116
+ results.extend(await asyncio.gather(*batch))
117
+
118
+ return results
@@ -399,7 +399,7 @@ async def dedupe_extracted_edge(
399
399
  )
400
400
 
401
401
  if duplicate_fact_id >= 0 and episode is not None:
402
- edge.episodes += episode.uuid
402
+ edge.episodes.append(episode.uuid)
403
403
 
404
404
  end = time()
405
405
  logger.debug(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: graphiti-core
3
- Version: 0.11.6rc4
3
+ Version: 0.11.6rc6
4
4
  Summary: A temporal graph building library
5
5
  License: Apache-2.0
6
6
  Author: Paul Paliychuk
@@ -12,7 +12,7 @@ graphiti_core/embedder/voyage.py,sha256=gQhdcz2IYPSyOcDn3w8aHToVS3KQhyZrUBm4vqr3
12
12
  graphiti_core/errors.py,sha256=Nib1uQx2cO_VOizupmRjpFfmuRg-hFAVqTtZAuBehR8,2405
13
13
  graphiti_core/graphiti.py,sha256=niRU1sZ2hf3a8WUPQAEIOsg8ixR_r_NUau5famfe1uM,27090
14
14
  graphiti_core/graphiti_types.py,sha256=46ueysKPwUCpxkMePHdCJLspfTImoZN7JiRwpz7cqd0,1013
15
- graphiti_core/helpers.py,sha256=Rj_ayM7hphlyY4v0ln_9vjFtr76aTjLVenYny0Wntwo,3086
15
+ graphiti_core/helpers.py,sha256=iRN1gFMrYa07C5MyaQkefiD5t0itfNddczyLmLIxRs0,3465
16
16
  graphiti_core/llm_client/__init__.py,sha256=PA80TSMeX-sUXITXEAxMDEt3gtfZgcJrGJUcyds1mSo,207
17
17
  graphiti_core/llm_client/anthropic_client.py,sha256=392rtkH_I7yOJUlQvjoOnS8Lz14WBP8egQ3OfRH0nFs,12481
18
18
  graphiti_core/llm_client/client.py,sha256=v_w5TBbDJYYADCXSs2r287g5Ami2Urma-GGEbHSI_Jg,5826
@@ -54,13 +54,13 @@ graphiti_core/utils/bulk_utils.py,sha256=_56TZ_gyOt3V5UAmiGhSNtcWOVgZdLZ9rAYCkvk
54
54
  graphiti_core/utils/datetime_utils.py,sha256=Ti-2tnrDFRzBsbfblzsHybsM3jaDLP4-VT2t0VhpIzU,1357
55
55
  graphiti_core/utils/maintenance/__init__.py,sha256=vW4H1KyapTl-OOz578uZABYcpND4wPx3Vt6aAPaXh78,301
56
56
  graphiti_core/utils/maintenance/community_operations.py,sha256=TF-4eHuvMe_jMqvWg3swxK80zLLtOR0t1pmUUQlNulM,10067
57
- graphiti_core/utils/maintenance/edge_operations.py,sha256=mnm-9Qps6poV7ix0BtCYI3rACVb7b1JyA2gusiManQU,14751
57
+ graphiti_core/utils/maintenance/edge_operations.py,sha256=vjeCUt_WlKZ3SRIIgaF9pqc8Na6ajLOzUIo2pWo7NyU,14756
58
58
  graphiti_core/utils/maintenance/graph_data_operations.py,sha256=BIJKc8tbvU4IjWxLgeotw57b1eE3Iw8YtV74j6eo4RQ,7493
59
59
  graphiti_core/utils/maintenance/node_operations.py,sha256=VMiDrzXryUV7-_btDVw87K3OawYeC9-9UqNQbfC5Bbo,15316
60
60
  graphiti_core/utils/maintenance/temporal_operations.py,sha256=mJkw9xLB4W2BsLfC5POr0r-PHWL9SIfNj_l_xu0B5ug,3410
61
61
  graphiti_core/utils/maintenance/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  graphiti_core/utils/ontology_utils/entity_types_utils.py,sha256=QJX5cG0GSSNF_Mm_yrldr69wjVAbN_MxLhOSznz85Hk,1279
63
- graphiti_core-0.11.6rc4.dist-info/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
64
- graphiti_core-0.11.6rc4.dist-info/METADATA,sha256=Q7NixQjg9eI5oOvT5faMjZcVDU8_H1xxV6u5rqgtyus,15301
65
- graphiti_core-0.11.6rc4.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
66
- graphiti_core-0.11.6rc4.dist-info/RECORD,,
63
+ graphiti_core-0.11.6rc6.dist-info/LICENSE,sha256=KCUwCyDXuVEgmDWkozHyniRyWjnWUWjkuDHfU6o3JlA,11325
64
+ graphiti_core-0.11.6rc6.dist-info/METADATA,sha256=kpR2OKGYOpTt1EnVoD6cWhLOI0vXOGyWdeY9JgjQn7g,15301
65
+ graphiti_core-0.11.6rc6.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
66
+ graphiti_core-0.11.6rc6.dist-info/RECORD,,