This commit is contained in:
Nuno Campos
2024-08-15 09:40:53 -07:00
parent 2c8fc3c9c6
commit c701fef634
4 changed files with 12 additions and 4 deletions
+1 -3
View File
@@ -10,7 +10,7 @@ from langchain_core.utils.input import get_bolded_text, get_colored_text
from langgraph.channels.base import BaseChannel
from langgraph.checkpoint.base import Checkpoint, CheckpointMetadata, PendingWrite
from langgraph.constants import INTERRUPT, TAG_HIDDEN
from langgraph.constants import TAG_HIDDEN
from langgraph.pregel.io import read_channels
from langgraph.pregel.types import PregelExecutableTask
@@ -127,12 +127,10 @@ def map_debug_checkpoint(
"timestamp": checkpoint["ts"],
"step": step,
"payload": {
"id": checkpoint["id"],
"config": config,
"values": read_channels(channels, stream_channels),
"metadata": metadata,
"next": [t.name for t in tasks],
"interrupts": [v for tid, n, v in pending_writes or [] if n == INTERRUPT],
},
}
+1 -1
View File
@@ -233,7 +233,7 @@ class PregelLoop:
self.stream.extend(
("debug", v)
for v in map_debug_checkpoint(
self.step,
self.step - 1, # printing checkpoint for previous step
self.checkpoint_config,
self.channels,
self.graph.stream_channels_asis,
+5
View File
@@ -6260,6 +6260,7 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": -1,
"writes": {"my_key": "value", "market": "DE"},
},
"next": ["__start__"],
},
},
{
@@ -6287,6 +6288,7 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 0,
"writes": None,
},
"next": ["prepare"],
},
},
{
@@ -6335,6 +6337,7 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 1,
"writes": {"prepare": {"my_key": " prepared"}},
},
"next": ["tool_two_slow"],
},
},
{
@@ -6383,6 +6386,7 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 2,
"writes": {"tool_two_slow": {"my_key": " slow"}},
},
"next": ["finish"],
},
},
{
@@ -6431,6 +6435,7 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 3,
"writes": {"finish": {"my_key": " finished"}},
},
"next": [],
},
},
]
@@ -4885,6 +4885,7 @@ async def test_branch_then() -> None:
"step": -1,
"writes": {"my_key": "value", "market": "DE"},
},
"next": ["__start__"],
},
},
{
@@ -4912,6 +4913,7 @@ async def test_branch_then() -> None:
"step": 0,
"writes": None,
},
"next": ["prepare"],
},
},
{
@@ -4960,6 +4962,7 @@ async def test_branch_then() -> None:
"step": 1,
"writes": {"prepare": {"my_key": " prepared"}},
},
"next": ["tool_two_slow"],
},
},
{
@@ -5008,6 +5011,7 @@ async def test_branch_then() -> None:
"step": 2,
"writes": {"tool_two_slow": {"my_key": " slow"}},
},
"next": ["finish"],
},
},
{
@@ -5056,6 +5060,7 @@ async def test_branch_then() -> None:
"step": 3,
"writes": {"finish": {"my_key": " finished"}},
},
"next": [],
},
},
]