INNER CODE UNIT · Python

__step_through_instructions

handrew/browserpilot · browserpilot/agents/gpt_selenium_agent.py:346

    def __step_through_instructions(self):
        """In contrast to `__run_compiled_instructions`, this function will
        step through the instructions queue one at a time, calling the LLM for
        each instruction."""
        ldict = {"env": self}
        while self.instruction_compiler.instructions_queue:
            # `step` will try the instruction for the first time.
            step = self.instruction_compiler.step()

            instruction = step["instruction"]
            action = step["action_output"]
            self.__print_instruction_and_action(instruction, action)

            # Attempt evals.
            attempts = 0
            while attempts < 3:
                attempts = attempts + 1
                action = action.replace("```", "")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…