mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-11 20:27:54 +02:00
Apply patch
This commit is contained in:
@@ -545,6 +545,10 @@ def coerce_to_runnable(
|
||||
A Runnable.
|
||||
"""
|
||||
if isinstance(thing, Runnable):
|
||||
# Check if this is a PregelProtocol instance (compiled subgraph)
|
||||
# and wrap it to handle runtime context propagation
|
||||
if PregelProtocol is not None and isinstance(thing, PregelProtocol):
|
||||
return _PregelWrapper(thing, name=name)
|
||||
return thing
|
||||
elif is_async_generator(thing) or inspect.isgeneratorfunction(thing):
|
||||
return RunnableLambda(thing, name=name)
|
||||
@@ -949,3 +953,4 @@ async def _consume_aiter(it: AsyncIterator[Any]) -> Any:
|
||||
return output
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user