Merge pull request #2437 from langchain-ai/nc/16nov/speed-up-find-subgraph

lib: find_subgraph doesn't need to look in both func and afunc
This commit is contained in:
Nuno Campos
2024-11-18 15:59:58 -08:00
committed by GitHub
+1 -1
View File
@@ -48,7 +48,7 @@ def find_subgraph_pregel(candidate: Runnable) -> Optional[Runnable]:
nl.__self__ if hasattr(nl, "__self__") else nl
for nl in get_function_nonlocals(c.func)
)
if c.afunc is not None:
elif c.afunc is not None:
candidates.extend(
nl.__self__ if hasattr(nl, "__self__") else nl
for nl in get_function_nonlocals(c.afunc)