Designing prompts for complex task decomposition
To enable effective multi-step reasoning, prompts should guide the LLM to break down complex tasks into smaller, manageable steps. Here’s an example of a task decomposition prompt:
def task_decomposition_prompt(task, available_tools): prompt = f"""Given the following complex task: {task} And the following available tools: {' '.join(f'- {tool}' for tool in available_tools)} Please break down the task into smaller, logical steps. For each step, indicate if a specific tool should be used. If no tool is needed, explain the reasoning required. Your task decomposition: Step 1: Step 2: Step 3: ... Ensure that the steps are in a logical order and cover all aspects of the task. """ return prompt # Example usage task = "Analyze the sentiment of tweets about a new product launch and create a summary report with visualizations."...