diff --git a/libs/langgraph/langgraph/pregel/algo.py b/libs/langgraph/langgraph/pregel/algo.py index a6b9ca52e..33c3bf2bb 100644 --- a/libs/langgraph/langgraph/pregel/algo.py +++ b/libs/langgraph/langgraph/pregel/algo.py @@ -610,7 +610,6 @@ def prepare_single_task( args_key.encode() if isinstance(args_key, str) else args_key, ), cache_policy.ttl, - cache_policy.refresh, ) else: cache_key = None @@ -734,7 +733,6 @@ def prepare_single_task( args_key.encode() if isinstance(args_key, str) else args_key, ), cache_policy.ttl, - cache_policy.refresh, ) else: cache_key = None @@ -869,7 +867,6 @@ def prepare_single_task( else args_key, ), cache_policy.ttl, - cache_policy.refresh, ) else: cache_key = None diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index 2c3e26259..204dbdd3e 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -1071,7 +1071,7 @@ class SyncPregelLoop(PregelLoop, AbstractContextManager): if cached := { (t.cache_key.ns, t.cache_key.key): t for t in self.tasks.values() - if t.cache_key and not t.cache_key.refresh and not t.writes + if t.cache_key and not t.writes }: for key, values in self.cache.get(tuple(cached)).items(): task = cached[key] @@ -1260,7 +1260,7 @@ class AsyncPregelLoop(PregelLoop, AbstractAsyncContextManager): if cached := { (t.cache_key.ns, t.cache_key.key): t for t in self.tasks.values() - if t.cache_key and not t.cache_key.refresh and not t.writes + if t.cache_key and not t.writes }: for key, values in (await self.cache.aget(tuple(cached))).items(): task = cached[key] diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index c77a2bc3b..06bc20cfd 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -137,9 +137,6 @@ class CachePolicy(Generic[KeyFuncT]): ttl: Optional[int] = None """Time to live for the cache entry in seconds. If None, the entry never expires.""" - refresh: bool = False - """Whether to force a refresh of the cache entry when it is accessed.""" - @dataclasses.dataclass(**_DC_KWARGS) class Interrupt: @@ -193,8 +190,6 @@ class CacheKey(NamedTuple): """Key for the cache entry.""" ttl: Optional[int] """Time to live for the cache entry in seconds.""" - refresh: bool - """Whether to force a refresh of the cache entry when it is accessed.""" @dataclasses.dataclass(**_T_DC_KWARGS)