Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Jan 24, 2025
1 parent 1093dd5 commit 996b120
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions libs/langgraph/tests/test_pregel_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import operator
import random
import sys
import time
import uuid
from collections import Counter, deque
from contextlib import asynccontextmanager, contextmanager
Expand Down Expand Up @@ -2554,40 +2553,6 @@ async def graph(input: list[int]) -> list[str]:
"11answera",
]

def syncmapper(input: int) -> str:
time.sleep(input / 100)
return submapper(input).result() * 2

@entrypoint(checkpointer=checkpointer)
async def graph(input: list[int]) -> list[str]:
mapped = [syncmapper(i) for i in input]
answer = interrupt("question")
final = [m + answer for m in mapped]
return await add_a.ainvoke(final)

thread1 = {"configurable": {"thread_id": "1"}}
assert [c async for c in graph.astream([0, 1], thread1)] == [
{"submapper": "0"},
{"syncmapper": "00"},
{"submapper": "1"},
{"syncmapper": "11"},
{
"__interrupt__": (
Interrupt(
value="question",
resumable=True,
ns=[AnyStr("graph:")],
when="during",
),
)
},
]

assert await graph.ainvoke(Command(resume="answer"), thread1) == [
"00answera",
"11answera",
]


@NEEDS_CONTEXTVARS
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_ASYNC)
Expand Down

0 comments on commit 996b120

Please sign in to comment.