Browse Source

Reset agent between tasks (#1182)

Co-authored-by: Robert Brennan <accounts@rbren.io>
Yoni 1 year ago
parent
commit
c8c1eed5be
2 changed files with 5 additions and 0 deletions
  1. 4 0
      agenthub/monologue_agent/agent.py
  2. 1 0
      opendevin/controller/agent_controller.py

+ 4 - 0
agenthub/monologue_agent/agent.py

@@ -233,3 +233,7 @@ class MonologueAgent(Agent):
         - List[str]: A list of top 10 text results that matched the query
         """
         return self.memory.search(query)
+
+    def reset(self) -> None:
+        super().reset()
+        self.monologue = Monologue()

+ 1 - 0
opendevin/controller/agent_controller.py

@@ -79,6 +79,7 @@ class AgentController:
                 break
         if not finished:
             logger.info('Exited before finishing the task.')
+        self.agent.reset()
 
     async def step(self, i: int):
         logger.info(f'STEP {i}', extra={'msg_type': 'STEP'})