Skip to content

Commit 6c629b5

Browse files
authored
Fixed arguments passed to InvalidTool.run(). (langchain-ai#1340)
[InvalidTool.run()](https://github.com/hwchase17/langchain/blob/72ef69d1ba33f052bf3948c1e1d7d6441b14af0a/langchain/agents/tools.py#L43) returns "{arg}is not a valid tool, try another one.". However, no function name is actually given in the argument. This causes LLM to be stuck in a loop, unable to find the right tool. This may resolve these Issues. langchain-ai#998 langchain-ai#702
1 parent 3574418 commit 6c629b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

langchain/agents/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def _take_next_step(
426426
)
427427
else:
428428
observation = InvalidTool().run(
429-
output.tool_input,
429+
output.tool,
430430
verbose=self.verbose,
431431
color=None,
432432
llm_prefix="",
@@ -473,7 +473,7 @@ async def _atake_next_step(
473473
)
474474
else:
475475
observation = await InvalidTool().arun(
476-
output.tool_input,
476+
output.tool,
477477
verbose=self.verbose,
478478
color=None,
479479
llm_prefix="",

0 commit comments

Comments
 (0)