Skip to content

Commit

Permalink
Fixed arguments passed to InvalidTool.run(). (#1340)
Browse files Browse the repository at this point in the history
[InvalidTool.run()](https://github.com/hwchase17/langchain/blob/aa7e6ae88e1aa6777bc018fcb7f185bb6f1b6f21/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/langchain#998
langchain-ai/langchain#702
  • Loading branch information
kurehajime committed Mar 1, 2023
1 parent 105a049 commit a3a8877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions langchain/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _take_next_step(
)
else:
observation = InvalidTool().run(
output.tool_input,
output.tool,
verbose=self.verbose,
color=None,
llm_prefix="",
Expand Down Expand Up @@ -473,7 +473,7 @@ async def _atake_next_step(
)
else:
observation = await InvalidTool().arun(
output.tool_input,
output.tool,
verbose=self.verbose,
color=None,
llm_prefix="",
Expand Down

0 comments on commit a3a8877

Please sign in to comment.