mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-21 07:02:25 +02:00
Run branch.reader in bg thread
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import logging
|
||||
from collections import defaultdict
|
||||
from typing import (
|
||||
@@ -97,7 +98,7 @@ class Branch(NamedTuple):
|
||||
writer: Callable[[list[str], RunnableConfig], Optional[Runnable]],
|
||||
) -> Runnable:
|
||||
if reader:
|
||||
value = reader(config)
|
||||
value = await asyncio.to_thread(reader, config)
|
||||
# passthrough additional keys from node to branch
|
||||
# only doable when using dict states
|
||||
if isinstance(value, dict) and isinstance(input, dict):
|
||||
|
||||
Reference in New Issue
Block a user