File tree Expand file tree Collapse file tree 4 files changed +16
-46
lines changed
.semversioner/next-release
operations/summarize_communities Expand file tree Collapse file tree 4 files changed +16
-46
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " patch" ,
3+ "description" : " Remove hard-coded community rate limiter."
4+ }
Original file line number Diff line number Diff line change @@ -97,9 +97,19 @@ def create_cosmosdb_cache(**kwargs) -> PipelineCache:
9797 return JsonPipelineCache (storage )
9898
9999
100+ def create_noop_cache (** _kwargs ) -> PipelineCache :
101+ """Create a no-op cache implementation."""
102+ return NoopPipelineCache ()
103+
104+
105+ def create_memory_cache (** kwargs ) -> PipelineCache :
106+ """Create a memory cache implementation."""
107+ return InMemoryCache (** kwargs )
108+
109+
100110# --- register built-in cache implementations ---
101- CacheFactory .register (CacheType .none .value , NoopPipelineCache )
102- CacheFactory .register (CacheType .memory .value , InMemoryCache )
111+ CacheFactory .register (CacheType .none .value , create_noop_cache )
112+ CacheFactory .register (CacheType .memory .value , create_memory_cache )
103113CacheFactory .register (CacheType .file .value , create_file_cache )
104114CacheFactory .register (CacheType .blob .value , create_blob_cache )
105115CacheFactory .register (CacheType .cosmosdb .value , create_cosmosdb_cache )
Original file line number Diff line number Diff line change 1616 Finding ,
1717 StrategyConfig ,
1818)
19- from graphrag .index .utils .rate_limiter import RateLimiter
2019from graphrag .language_model .manager import ModelManager
2120from graphrag .language_model .protocol .base import ChatModel
2221
@@ -51,8 +50,6 @@ async def _run_extractor(
5150 level : int ,
5251 args : StrategyConfig ,
5352) -> CommunityReport | None :
54- # RateLimiter
55- rate_limiter = RateLimiter (rate = 1 , per = 60 )
5653 extractor = CommunityReportsExtractor (
5754 model ,
5855 extraction_prompt = args .get ("extraction_prompt" , None ),
@@ -63,7 +60,6 @@ async def _run_extractor(
6360 )
6461
6562 try :
66- await rate_limiter .acquire ()
6763 results = await extractor (input )
6864 report = results .structured_output
6965 if report is None :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments