mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-27 20:15:00 +02:00
Lint
This commit is contained in:
@@ -29,7 +29,7 @@ from langgraph.constants import (
|
||||
NS_SEP,
|
||||
TAG_HIDDEN,
|
||||
)
|
||||
from langgraph.pregel.io import map_output_updates, read_channels, single
|
||||
from langgraph.pregel.io import read_channels
|
||||
from langgraph.pregel.utils import find_subgraph_pregel
|
||||
from langgraph.types import PregelExecutableTask, PregelTask, StateSnapshot
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from langchain_core.runnables.utils import AddableDict
|
||||
from langgraph.channels.base import BaseChannel, EmptyChannelError
|
||||
from langgraph.constants import EMPTY_SEQ, ERROR, INTERRUPT, TAG_HIDDEN
|
||||
from langgraph.pregel.log import logger
|
||||
from langgraph.types import PregelExecutableTask, PregelTask
|
||||
from langgraph.types import PregelExecutableTask
|
||||
|
||||
|
||||
def read_channel(
|
||||
@@ -99,20 +99,14 @@ class AddableUpdatesDict(AddableDict):
|
||||
|
||||
def map_output_updates(
|
||||
output_channels: Union[str, Sequence[str]],
|
||||
tasks: list[
|
||||
tuple[Union[PregelTask, PregelExecutableTask], Sequence[tuple[str, Any]]]
|
||||
],
|
||||
tasks: list[tuple[PregelExecutableTask, Sequence[tuple[str, Any]]]],
|
||||
cached: bool = False,
|
||||
) -> Iterator[dict[str, Union[Any, dict[str, Any]]]]:
|
||||
"""Map pending writes (a sequence of tuples (channel, value)) to output chunk."""
|
||||
output_tasks = [
|
||||
(t, ww)
|
||||
for t, ww in tasks
|
||||
if (
|
||||
not hasattr(t, "config")
|
||||
or not t.config
|
||||
or TAG_HIDDEN not in t.config.get("tags", EMPTY_SEQ)
|
||||
)
|
||||
if (not t.config or TAG_HIDDEN not in t.config.get("tags", EMPTY_SEQ))
|
||||
and ww[0][0] != ERROR
|
||||
and ww[0][0] != INTERRUPT
|
||||
]
|
||||
|
||||
@@ -154,6 +154,8 @@ class RemoteGraph(PregelProtocol, Runnable):
|
||||
interrupts=tuple(interrupts),
|
||||
state=self._create_state_snapshot(task["state"])
|
||||
if task["state"]
|
||||
else {"configurable": task["checkpoint"]}
|
||||
if task["checkpoint"]
|
||||
else None,
|
||||
result=task.get("result"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user