INNER CODE UNIT · Python
set_instructions
handrew/browserpilot · browserpilot/agents/gpt_selenium_agent.py:399
def set_instructions(self, instructions):
"""Reset the instructions to `instructions`."""
self.instruction_compiler.set_instructions(instructions)
def run(self):
"""Run the agent."""
should_use_compiled = self.instruction_compiler.use_compiled
compiled = self.instruction_compiler.compiled_instructions
if should_use_compiled and compiled:
logger.info("Found cached instructions. Running...")
instructions = self.instruction_compiler.compiled_instructions
instructions = "\n".join(instructions).replace("```", "")
self.__run_compiled_instructions(instructions)
else:
logger.info("No cached instructions found. Running...")
self.__step_through_instructions()
"""Functions exposed to the agent via the text prompt."""