From 28de8d132c8c4f7ecfe246c61375d91a04ff0abf Mon Sep 17 00:00:00 2001 From: stopdropandrew Date: Thu, 7 Sep 2023 19:54:53 -0700 Subject: [PATCH] Change StructuredTool's ainvoke to await (#10300) Fixes #10080. StructuredTool's `ainvoke` doesn't `await`. --- libs/langchain/langchain/tools/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/tools/base.py b/libs/langchain/langchain/tools/base.py index 9ad81033d5d9a..69597cd903836 100644 --- a/libs/langchain/langchain/tools/base.py +++ b/libs/langchain/langchain/tools/base.py @@ -592,7 +592,7 @@ async def ainvoke( None, partial(self.invoke, input, config, **kwargs) ) - return super().ainvoke(input, config, **kwargs) + return await super().ainvoke(input, config, **kwargs) # --- Tool ---