Use this file to discover all available pages before exploring further.
Prompts are the initial instructions given to agents at the start of an episode. They provide the context and goal for the task, forming the agent’s initial observation.
[ { "text": "You are given a Python programming challenge.\n\nWrite a function that reverses a string.\n\nRequirements:\n-Function name: reverse_string\n-Input: string\n-Output: reversed string\n\nYou have access to a Python REPL. Submit your function when ready.", "detail": null, "type": "text" }]
def get_prompt(self) -> Blocks: problem = self.task_spec["problem"] prompt_text = f"""You are a coding assistant. Solve the following problem:{problem}You have access to a Python REPL. Use the 'python' tool to write and test code.When you have a solution, use the 'submit' tool.""" return [TextBlock(text=prompt_text)]
Note the tool instructions may be redundant if the available are already passed into the agent’s context.
def get_prompt(self) -> Blocks: scenario = self.task_spec["scenario"] prompt_text = f"""You are a customer service agent.A customer has the following issue:{scenario}Your goal is to resolve their issue professionally and efficiently.Use the 'respond' tool to communicate with the customer.""" return [TextBlock(text=prompt_text)]
Prompts can be customized based on task properties:
def get_prompt(self) -> Blocks: difficulty = self.task_spec.get("difficulty", "medium") if difficulty == "easy": instructions = "This is a simple problem. Take your time." elif difficulty == "hard": instructions = "This is a challenging problem. Think carefully and use all available tools." else: instructions = "Solve this problem step by step." problem = self.task_spec["problem"] return [TextBlock(text=f"{instructions}\n\nProblem: {problem}")]
Key Takeaway: Prompts are the agent’s starting point for each episode. Design them to be clear, specific, and informative. Good prompts guide agents toward successful task completion by setting context.