From 86d2847dabf968aa9c759044d31fee00593d4210 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Mon, 11 Nov 2024 17:57:45 -0800 Subject: [PATCH] Use neg idx --- libs/checkpoint/langgraph/checkpoint/base/__init__.py | 3 ++- libs/checkpoint/langgraph/checkpoint/serde/types.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/checkpoint/langgraph/checkpoint/base/__init__.py b/libs/checkpoint/langgraph/checkpoint/base/__init__.py index a63bbce28..a3ad83b1a 100644 --- a/libs/checkpoint/langgraph/checkpoint/base/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/base/__init__.py @@ -25,6 +25,7 @@ from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer from langgraph.checkpoint.serde.types import ( ERROR, INTERRUPT, + RESUME, SCHEDULED, ChannelProtocol, SendProtocol, @@ -450,4 +451,4 @@ Special writes (e.g. errors) map to negative indices, to avoid those writes from conflicting with regular writes. Each Checkpointer implementation should use this mapping in put_writes. """ -WRITES_IDX_MAP = {ERROR: -1, SCHEDULED: -2, INTERRUPT: -3} +WRITES_IDX_MAP = {ERROR: -1, SCHEDULED: -2, INTERRUPT: -3, RESUME: -4} diff --git a/libs/checkpoint/langgraph/checkpoint/serde/types.py b/libs/checkpoint/langgraph/checkpoint/serde/types.py index 9286e9b19..e258735bc 100644 --- a/libs/checkpoint/langgraph/checkpoint/serde/types.py +++ b/libs/checkpoint/langgraph/checkpoint/serde/types.py @@ -13,6 +13,7 @@ from typing_extensions import Self ERROR = "__error__" SCHEDULED = "__scheduled__" INTERRUPT = "__interrupt__" +RESUME = "__resume__" TASKS = "__pregel_tasks" Value = TypeVar("Value", covariant=True)