From 75ce4474e5411713da56d72b76c8f39e2011b38c Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 4 Apr 2024 14:57:52 -0400 Subject: [PATCH 1/2] x --- langgraph/checkpoint/base.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/langgraph/checkpoint/base.py b/langgraph/checkpoint/base.py index 7fe967a8b..125adca03 100644 --- a/langgraph/checkpoint/base.py +++ b/langgraph/checkpoint/base.py @@ -13,11 +13,29 @@ from langgraph.utils import StrEnum class Checkpoint(TypedDict): + """State snapshot at a given point in time.""" v: int + """The version of the checkpoint format. Currently 1.""" ts: str + """The timestamp of the checkpoint in ISO 8601 format.""" channel_values: dict[str, Any] + """The values of the channels at the time of the checkpoint. + + Mapping from channel name to channel snapshot value. + """ channel_versions: defaultdict[str, int] + """The versions of the channels at the time of the checkpoint. + + The keys are channel names and the values are the logical time step + at which the channel was last updated. + """ versions_seen: defaultdict[str, defaultdict[str, int]] + """Map from node ID to map from channel name to version seen. + + This keeps track of the versions of the channels that each node has seen. + + Used to determine which nodes to execute next. + """ def _seen_dict(): From 21ce5757396d4e11cac22fa4e9126dd84527f75a Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 4 Apr 2024 15:01:03 -0400 Subject: [PATCH 2/2] x --- langgraph/checkpoint/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/langgraph/checkpoint/base.py b/langgraph/checkpoint/base.py index 125adca03..e63a00201 100644 --- a/langgraph/checkpoint/base.py +++ b/langgraph/checkpoint/base.py @@ -14,6 +14,7 @@ from langgraph.utils import StrEnum class Checkpoint(TypedDict): """State snapshot at a given point in time.""" + v: int """The version of the checkpoint format. Currently 1.""" ts: str