mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-03 13:43:24 +00:00
Fix Runnable Lambda Afunc Repr (#13413)
Otherwise, you get an error when using async functions. h/t to Chris Ruppelt
This commit is contained in:
parent
1726d5dcdd
commit
ba501b27a0
@ -2430,7 +2430,12 @@ class RunnableLambda(Runnable[Input, Output]):
|
|||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
"""A string representation of this runnable."""
|
"""A string representation of this runnable."""
|
||||||
|
if hasattr(self, "func"):
|
||||||
return f"RunnableLambda({get_lambda_source(self.func) or '...'})"
|
return f"RunnableLambda({get_lambda_source(self.func) or '...'})"
|
||||||
|
elif hasattr(self, "afunc"):
|
||||||
|
return f"RunnableLambda(afunc={get_lambda_source(self.afunc) or '...'})"
|
||||||
|
else:
|
||||||
|
return "RunnableLambda(...)"
|
||||||
|
|
||||||
def _invoke(
|
def _invoke(
|
||||||
self,
|
self,
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user