This commit is contained in:
Nuno Campos
2025-01-14 17:09:30 -08:00
parent 7bdbd62611
commit 901273c0e2
3 changed files with 6 additions and 5 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
import sys
from collections import defaultdict, deque
from contextvars import Context
from functools import partial
from hashlib import sha1
from typing import (
@@ -122,7 +121,7 @@ class Call:
input: Any,
*,
retry: Optional[RetryPolicy],
callbacks: Optional[Context],
callbacks: Optional[Callbacks],
) -> None:
self.func = func
self.input = input
+4 -1
View File
@@ -65,7 +65,10 @@ class BackgroundExecutor(ContextManager):
) -> concurrent.futures.Future[T]:
ctx = copy_context()
if __next_tick__:
task = self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs)
task = cast(
concurrent.futures.Future[T],
self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs), # type: ignore[arg-type]
)
else:
task = self.executor.submit(ctx.run, fn, *args, **kwargs)
self.tasks[task] = (__cancel_on_exit__, __reraise_on_exit__)
+1 -2
View File
@@ -443,7 +443,6 @@ def interrupt(value: Any) -> Any:
GraphInterrupt: On the first invocation within the node, halts execution and surfaces the provided value to the client.
"""
from langgraph.constants import (
CONF,
CONFIG_KEY_CHECKPOINT_NS,
CONFIG_KEY_SCRATCHPAD,
CONFIG_KEY_SEND,
@@ -456,7 +455,7 @@ def interrupt(value: Any) -> Any:
from langgraph.errors import GraphInterrupt
from langgraph.utils.config import get_config
conf = get_config()[CONF]
conf = get_config()["configurable"]
# track interrupt index
scratchpad: PregelScratchpad = conf[CONFIG_KEY_SCRATCHPAD]
if "interrupt_counter" not in scratchpad: