diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index 4b7e36ee0..d1b68b4eb 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -126,11 +126,9 @@ class RetryPolicy(NamedTuple): KeyFuncT = TypeVar("KeyFuncT", bound=Callable[..., str | bytes]) -class CachePolicy(NamedTuple, Generic[KeyFuncT]): - """Configuration for caching nodes. - - !!! version-added "Added in version 0.2.24." - """ +@dataclasses.dataclass(**_DC_KWARGS) +class CachePolicy(Generic[KeyFuncT]): + """Configuration for caching nodes.""" key_func: KeyFuncT = default_cache_key # type: ignore[assignment] """Function to generate a cache key from the node's input.