Skip to content

Commit 768ffe7

Browse files
committed
Add memory cache factory
1 parent ffe8301 commit 768ffe7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

graphrag/cache/factory.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,14 @@ def create_noop_cache(**_kwargs) -> PipelineCache:
102102
return NoopPipelineCache()
103103

104104

105+
def create_memory_cache(**kwargs) -> PipelineCache:
106+
"""Create a memory cache implementation."""
107+
return InMemoryCache(**kwargs)
108+
109+
105110
# --- register built-in cache implementations ---
106111
CacheFactory.register(CacheType.none.value, create_noop_cache)
107-
CacheFactory.register(CacheType.memory.value, InMemoryCache)
112+
CacheFactory.register(CacheType.memory.value, create_memory_cache)
108113
CacheFactory.register(CacheType.file.value, create_file_cache)
109114
CacheFactory.register(CacheType.blob.value, create_blob_cache)
110115
CacheFactory.register(CacheType.cosmosdb.value, create_cosmosdb_cache)

0 commit comments

Comments
 (0)