INNER CODE UNIT · Python
__complete
handrew/browserpilot · browserpilot/agents/gpt_selenium_agent.py:240
def __complete(self):
"""What to run when the agent is done."""
if self.memory_folder:
self.memory.save(self.memory_folder)
if self.close_after_completion:
self.driver.quit()
def __run_compiled_instructions(self, instructions):
"""Runs Python code previously compiled by InstructionCompiler."""
ldict = {"env": self}
self._check_danger(instructions)
try:
exec(instructions, globals(), ldict)
except:
self.__handle_agent_exception(instructions)
self.__complete()