Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/langgraph/langgraph/pregel/_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ def get_name(self, suffix: str | None = None, *, name: str | None = None) -> str
return super().get_name(suffix, name=name)

def _read(self, _: Any, config: RunnableConfig) -> Any:
"""Read from the channel."""
return self.do_read(
config, select=self.channel, fresh=self.fresh, mapper=self.mapper
)

async def _aread(self, _: Any, config: RunnableConfig) -> Any:
"""Read from the channel asynchronously."""
return self.do_read(
config, select=self.channel, fresh=self.fresh, mapper=self.mapper
)
Expand Down Expand Up @@ -229,6 +231,7 @@ def invoke(
config: RunnableConfig | None = None,
**kwargs: Any | None,
) -> Any:
"""Invoke the node."""
self_config: RunnableConfig = {"metadata": self.metadata, "tags": self.tags}
return self.bound.invoke(
input,
Expand All @@ -242,6 +245,7 @@ async def ainvoke(
config: RunnableConfig | None = None,
**kwargs: Any | None,
) -> Any:
"""Invoke the node asynchronously."""
self_config: RunnableConfig = {"metadata": self.metadata, "tags": self.tags}
return await self.bound.ainvoke(
input,
Expand All @@ -255,6 +259,7 @@ def stream(
config: RunnableConfig | None = None,
**kwargs: Any | None,
) -> Iterator[Any]:
"""Stream output from the node."""
self_config: RunnableConfig = {"metadata": self.metadata, "tags": self.tags}
yield from self.bound.stream(
input,
Expand All @@ -268,6 +273,7 @@ async def astream(
config: RunnableConfig | None = None,
**kwargs: Any | None,
) -> AsyncIterator[Any]:
"""Stream output from the node asynchronously."""
self_config: RunnableConfig = {"metadata": self.metadata, "tags": self.tags}
async for item in self.bound.astream(
input,
Expand Down