Update src/prompts/prompts.py
Browse files104 unmodified lines1051061071081091101111121131141151161171181191201211221231241251261272 unmodified lines13013113213313413513613713813914014114216 unmodified lines159160161162163164165166167168169170171172173104 unmodified lines{{"id": "s2", "goal": "Calculate monthly growth rates using Python", "tool": "safe_code_run"}},{{"id": "s3", "goal": "Generate summary statistics and trends", "tool": "safe_code_run"}}]}}фExample 2: "Research recent AI developments and summarize key trends"{{"steps": [{{"id": "s1", "goal": "Search for recent AI news and developments", "tool": "web_search"}},{{"id": "s2", "goal": "Extract all info from founded urls", "tool": "web_extract"}},{{"id": "s3", "goal": "Extract and organize key information from articles", "tool": "analyze_(csv, docx, pdf etc.)_file"}},{{"id": "s4", "goal": "Analyze and synthesize key trends from gathered information", "tool": null}}]}}Example 3: "Compare performance metrics between two datasets"{{"steps": [{{"id": "s1", "goal": "Load first dataset and examine structure", "tool": "analyze_(csv, docx, pdf etc.)_file"}},{{"id": "s2", "goal": "Load second dataset and examine structure", "tool": "analyze_(csv, docx, pdf etc.)_file"}},{{"id": "s3", "goal": "Calculate statistical metrics for both datasets using code", "tool": "safe_code_run"}},{{"id": "s4", "goal": "Perform statistical comparison and significance testing", "tool": "safe_code_run"}}]2 unmodified linesExample 4: "Create a budget analysis from expense data"{{"steps": [{{"id": "s1", "goal": "Load expense data and validate format", "tool": "analyze_(csv, docx, pdf etc.)_file"}},{{"id": "s2", "goal": "Calculate category totals and percentages using code", "tool": "safe_code_run"}},{{"id": "s3", "goal": "Generate budget variance analysis and projections", "tool": "safe_code_run"}},{{"id": "s4", "goal": "Create visualization of spending patterns", "tool": "safe_code_run"}}]}}Return a single JSON object with this structure:{{"task_type": "info|calc|table|doc_qa|image_qa|multi_hop",16 unmodified linesGround rules:- Prefer 2-4 steps for most tasks. Single steps only for truly trivial queries. Calculation tasks must use tools always.- Break down complex tasks into logical components - don't try to solve everything at once- Use tool names exactly as listed. If no tool is needed, set "tool": null.- Never assume files or URLs exist—plan to search/extract before analysing.- Skip download steps when the required file is already provided.- Ensure later steps only depend on results created by earlier steps.- For any numerical work: ALWAYS use tools (calculator/code) - never manual calculation- If the query involves analysis of multiple sources, plan separate steps for each source- Consider data validation and error checking as separate steps when handling files- Plan for visualization or formatting steps when presenting complex results"""COMPLEXITY_ASSESSOR_PROMPT = """104 unmodified lines1051061071081091101111121131141151161171181191201211221231241251261271282 unmodified lines13113213313413513613713813914014114214314414514614714814915015115215315416 unmodified lines171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218104 unmodified lines{{"id": "s2", "goal": "Calculate monthly growth rates using Python", "tool": "safe_code_run"}},{{"id": "s3", "goal": "Generate summary statistics and trends", "tool": "safe_code_run"}}]}}Example 2: "Research recent AI developments and summarize key trends"{{"steps": [{{"id": "s1", "goal": "Search for recent AI news and developments", "tool": "tavily_search"}},{{"id": "s2", "goal": "Extract key links and pick relevant documents (PDF, reports)", "tool": "tavilyextract"}},{{"id": "s3", "goal": "Download chosen report for detailed analysis", "tool": "download_file_from_url"}},{{"id": "s4", "goal": "Analyze the downloaded document (PDF/DOCX/TXT)", "tool": "analyze_pdf_file"}},{{"id": "s5", "goal": "Summarize and synthesize key insights from the analyzed content", "tool": null}}]}}Example 3: "Compare performance metrics between two datasets"{{"steps": [{{"id": "s1", "goal": "Load first dataset and examine structure", "tool": "analyze_csv_file"}},{{"id": "s2", "goal": "Load second dataset and examine structure", "tool": "analyze_excel_file"}},{{"id": "s3", "goal": "Calculate statistical metrics for both datasets using code", "tool": "safe_code_run"}},{{"id": "s4", "goal": "Perform statistical comparison and significance testing", "tool": "safe_code_run"}}]2 unmodified linesExample 4: "Create a budget analysis from expense data"{{"steps": [{{"id": "s1", "goal": "Load expense data and validate format", "tool": "analyze_csv_file"}},{{"id": "s2", "goal": "Calculate category totals and percentages using code", "tool": "safe_code_run"}},{{"id": "s3", "goal": "Generate budget variance analysis and projections", "tool": "safe_code_run"}},{{"id": "s4", "goal": "Create visualization of spending patterns", "tool": "safe_code_run"}}]}}Example 5: "Find and analyze a scientific PDF report on renewable energy"{{"steps": [{{"id": "s1", "goal": "Search the web for renewable energy PDF reports", "tool": "tavily_search"}},{{"id": "s2", "goal": "Extract candidate PDF links from the search results", "tool": "tavilyextract"}},{{"id": "s3", "goal": "Download the most relevant PDF document", "tool": "download_file_from_url"}},{{"id": "s4", "goal": "Parse and extract text from the downloaded PDF", "tool": "analyze_pdf_file"}},{{"id": "s5", "goal": "Summarize findings and highlight key trends in renewable energy", "tool": null}}]}}Return a single JSON object with this structure:{{"task_type": "info|calc|table|doc_qa|image_qa|multi_hop",16 unmodified linesGround rules:- Prefer 2-4 steps for most tasks. Single steps only for truly trivial queries. Calculation tasks must use tools always.- Break down complex tasks into logical components - don't try to solve everything at once.- Use tool names exactly as listed. If no tool is needed, set "tool": null.- Never assume files or URLs exist—plan to search/extract before analysing.- Skip download steps when the required file is already provided.- Ensure later steps only depend on results created by earlier steps.- For any numerical work: ALWAYS use tools (calculator/code) - never manual calculation.- If the query involves analysis of multiple sources, plan separate steps for each source.- Consider data validation and error checking as separate steps when handling files.- Plan for visualization or formatting steps when presenting complex results."""SYSTEM_EXECUTOR_PROMPT = """You are the executor of a grounded multi-tool agent.Plan summary: {plan_summary}Step map:{plan_overview}Current focus: {current_step_id} — {step_goal}Suggested tool: {step_tool}Available tools: {tool_catalogue}Known local files: {file_list}CRITICAL COMPUTATION RULE: You MUST use tools for ANY numerical calculation, counting, or mathematical operation. This includes:- Simple arithmetic (use tools add, subtract, multiply, divide, power)- Data analysis and statistics (use safe_code_run)- Counting items, rows, or occurrences (use safe_code_run)- Percentage calculations (use add, subtract, multiply, divide, power/safe_code_run)- Any mathematical transformation or formula applicationNEVER perform manual calculations or provide estimated numbers.Execution rules:1. Stay aligned with the plan—no new steps or speculative actions.2. Before every tool call, respond with <REASONING>…</REASONING> explaining the step, chosen tool, inputs, and expected outcome.3. Call at most one tool per turn. After a successful step, state "STEP COMPLETE".4. If required inputs are missing (e.g., file not downloaded), explain the issue in <REASONING> and wait for replanning.5. Never invent file paths, URLs, or results. When unsure, request replanning instead of guessing.6. If no tool is needed, answer directly after the reasoning.7. For any calculation task: MANDATORY use of appropriate computational tools8. Validate your tool results before marking steps complete"""COMPLEXITY_ASSESSOR_PROMPT = """
src/prompts/prompts.py+58-13