langchain icon indicating copy to clipboard operation
langchain copied to clipboard

ValueError: Got unsupported early_stopping_method `generate`

Open assafelovic opened this issue 1 year ago • 1 comments

Using early_stopping_method with "generate" is not supported with new addition to custom LLM agents. More specifically:

agent_executor = AgentExecutor.from_agent_and_tools(agent=agent, tools=tools, verbose=True, max_execution_time=6, max_iterations=3, early_stopping_method="generate")

Stack trace: Traceback (most recent call last): File "/Users/assafel/Sites/gpt3-text-optimizer/agents/cowriter2.py", line 116, in <module> response = agent_executor.run("Some question") File "/usr/local/lib/python3.9/site-packages/langchain/chains/base.py", line 213, in run return self(args[0])[self.output_keys[0]] File "/usr/local/lib/python3.9/site-packages/langchain/chains/base.py", line 116, in __call__ raise e File "/usr/local/lib/python3.9/site-packages/langchain/chains/base.py", line 113, in __call__ outputs = self._call(inputs) File "/usr/local/lib/python3.9/site-packages/langchain/agents/agent.py", line 855, in _call output = self.agent.return_stopped_response( File "/usr/local/lib/python3.9/site-packages/langchain/agents/agent.py", line 126, in return_stopped_response raise ValueError( ValueError: Got unsupported early_stopping_methodgenerate``

assafelovic avatar Apr 08 '23 09:04 assafelovic

I also encountered this problem. Looking at the source code, I found that langchain does not currently support this parameter.

alex14dark avatar Apr 21 '23 12:04 alex14dark

Facing the same issue, is it resolved yet?

ChalamPVS avatar Aug 20 '23 09:08 ChalamPVS

I have the same promblems , how to solve it ?

niuhuluzhihao avatar Aug 22 '23 02:08 niuhuluzhihao

?

jeroaranda avatar Sep 20 '23 03:09 jeroaranda

I have the same issue.

JasonS09 avatar Oct 06 '23 13:10 JasonS09

hi there, any news on this one?

ndricca avatar Oct 24 '23 17:10 ndricca

Hi, @assafelovic,

I'm helping the LangChain team manage their backlog and am marking this issue as stale. It looks like you opened an issue regarding a ValueError encountered when using the early_stopping_method "generate" with a custom LLM agent. Several users, including alex14dark and ChalamPVS, have reported encountering the same issue and are seeking a resolution.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you!

dosubot[bot] avatar Feb 08 '24 16:02 dosubot[bot]

Hi, is this issue resolved? I'm running into the issue, please let me know how was this resolved if so, thanks!

zhengpu-zhao avatar Feb 19 '24 19:02 zhengpu-zhao

the issue still persists with langchain version 0.1.20

athmedata avatar May 12 '24 06:05 athmedata

2024.7.1 still persist

robotsouper avatar Jul 01 '24 06:07 robotsouper

2024.7.2 still persist

weinixuehao avatar Jul 02 '24 03:07 weinixuehao

2024.7.15 still persist, langchain 0.2.7

ElectricMs avatar Jul 15 '24 03:07 ElectricMs