mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-05 04:38:26 +00:00
Upper bound on number of iterations (#754)
Some custom agents might continue to iterate until they find the correct answer, getting stuck on loops that generate request after request and are really expensive for the end user. Putting an upper bound for the number of iterations by default controls this and can be explicitly tweaked by the user if necessary. Co-authored-by: Francisco Ingham <>
This commit is contained in:
parent
28efbb05bf
commit
374e510f94
@ -199,7 +199,7 @@ class AgentExecutor(Chain, BaseModel):
|
||||
agent: Agent
|
||||
tools: List[Tool]
|
||||
return_intermediate_steps: bool = False
|
||||
max_iterations: Optional[int] = None
|
||||
max_iterations: Optional[int] = 15
|
||||
early_stopping_method: str = "force"
|
||||
|
||||
@classmethod
|
||||
|
Loading…
Reference in New Issue
Block a user