forked from Archives/langchain
Fixed arguments passed to InvalidTool.run(). (#1340)
[InvalidTool.run()](72ef69d1ba/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.
https://github.com/hwchase17/langchain/issues/998
https://github.com/hwchase17/langchain/issues/702
This commit is contained in:
parent
3574418a40
commit
6c629b54e6
@ -426,7 +426,7 @@ class AgentExecutor(Chain, BaseModel):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
observation = InvalidTool().run(
|
observation = InvalidTool().run(
|
||||||
output.tool_input,
|
output.tool,
|
||||||
verbose=self.verbose,
|
verbose=self.verbose,
|
||||||
color=None,
|
color=None,
|
||||||
llm_prefix="",
|
llm_prefix="",
|
||||||
@ -473,7 +473,7 @@ class AgentExecutor(Chain, BaseModel):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
observation = await InvalidTool().arun(
|
observation = await InvalidTool().arun(
|
||||||
output.tool_input,
|
output.tool,
|
||||||
verbose=self.verbose,
|
verbose=self.verbose,
|
||||||
color=None,
|
color=None,
|
||||||
llm_prefix="",
|
llm_prefix="",
|
||||||
|
Loading…
Reference in New Issue
Block a user