mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 14:42:28 +02:00
- Topic channel combines the features of Inbox, Archive, UniqueInbox, UniqueArchive, which have been removed.
from permchain import Channel, Pregel
grow_value = (
Channel.subscribe_to("value")
| (lambda x: x + x)
| Channel.write_to(value=lambda x: x if len(x) < 10 else None)
)
app = Pregel(
chains={"grow_value": grow_value},
input="value",
output="value",
)
assert app.invoke("a") == "aaaaaaaa"