This commit is contained in:
William Fu-Hinthorn
2024-07-23 21:15:53 -07:00
parent 03bf1e5414
commit 36505d9656
2 changed files with 41 additions and 6 deletions
+9
View File
@@ -7,6 +7,7 @@ from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
Checkpoint,
CheckpointMetadata,
CheckpointTuple,
SerializerProtocol,
copy_checkpoint,
)
@@ -119,3 +120,11 @@ class MemorySaverAssertCheckpointMetadata(MemorySaver):
return await asyncio.get_running_loop().run_in_executor(
None, self.put, config, checkpoint, metadata
)
class MemorySaverNoPending(MemorySaver):
def get_tuple(self, config: RunnableConfig) -> CheckpointTuple | None:
result = super().get_tuple(config)
if result:
return CheckpointTuple(result.config, result.checkpoint, result.metadata)
return result