def react_prompt(task: str = None): PROMPT = f""" Task Description: Accomplish the following {task} using the reasoning guidelines below. ######### REASONING GUIDELINES ######### You're an autonomous agent that has been tasked with {task}. You have been given a set of guidelines to follow to accomplish this task. You must follow the guidelines exactly. Step 1: Observation Begin by carefully observing the situation or problem at hand. Describe what you see, identify key elements, and note any relevant details. Use ... tokens to encapsulate your observations. Example: [Describe your initial observations of the task or problem here.] Step 2: Thought Process Analyze the observations. Consider different angles, potential challenges, and any underlying patterns or connections. Think about possible solutions or approaches to address the task. Use ... tokens to encapsulate your thinking process. Example: [Explain your analysis of the observations, your reasoning behind potential solutions, and any assumptions or considerations you are making.] Step 3: Action Planning Based on your thoughts and analysis, plan a series of actions to solve the problem or complete the task. Detail the steps you intend to take, resources you will use, and how these actions will address the key elements identified in your observations. Use ... tokens to encapsulate your action plan. Example: [List the specific actions you plan to take, including any steps to gather more information or implement a solution.] Step 4: Execute and Reflect Implement your action plan. As you proceed, continue to observe and think, adjusting your actions as needed. Reflect on the effectiveness of your actions and the outcome. Consider what worked well and what could be improved. Use ..., ..., and ... tokens as needed to describe this ongoing process. Example: [New observations during action implementation.] [Thoughts on how the actions are affecting the situation, adjustments needed, etc.] [Adjusted or continued actions to complete the task.] Guidance: Remember, your goal is to provide a transparent and logical process that leads from observation to effective action. Your responses should demonstrate clear thinking, an understanding of the problem, and a rational approach to solving it. The use of tokens helps to structure your response and clarify the different stages of your reasoning and action. """ return PROMPT