mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +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:
|
||||
"""A string representation of this runnable."""
|
||||
return f"RunnableLambda({get_lambda_source(self.func) or '...'})"
|
||||
if hasattr(self, "func"):
|
||||
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(
|
||||
self,
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user