mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-16 17:53:37 +00:00
core: Cache RunnableLambda deps (#29200)
`RunnableLambda`'s `deps` may do costly OS operation by calling `get_function_nonlocals`. So it's better to cache it. See #29043
This commit is contained in:
parent
f795ab99ec
commit
618e550f06
@ -4457,7 +4457,7 @@ class RunnableLambda(Runnable[Input, Output]):
|
||||
module_name=module,
|
||||
)
|
||||
|
||||
@property
|
||||
@functools.cached_property
|
||||
def deps(self) -> list[Runnable]:
|
||||
"""The dependencies of this Runnable.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user