the 'state' and 'current_step' should be reset after every loop , cefengxu
This commit is contained in:
parent
8d18c05350
commit
e183913372
@ -144,8 +144,8 @@ class BaseAgent(BaseModel, ABC):
|
|||||||
results.append(f"Step {self.current_step}: {step_result}")
|
results.append(f"Step {self.current_step}: {step_result}")
|
||||||
|
|
||||||
if self.current_step >= self.max_steps:
|
if self.current_step >= self.max_steps:
|
||||||
self.current_step = 0 # setting back to 0 when reached max steps
|
self.current_step = 0 # setting back to 0 when reached max steps, cefengxu
|
||||||
self.state = AgentState.IDLE # setting the status
|
self.state = AgentState.IDLE # setting the status , cefengxu
|
||||||
results.append(f"Terminated: Reached max steps ({self.max_steps})")
|
results.append(f"Terminated: Reached max steps ({self.max_steps})")
|
||||||
|
|
||||||
return "\n".join(results) if results else "No steps executed"
|
return "\n".join(results) if results else "No steps executed"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user