Improve web research prompts.

This commit is contained in:
user 2024-12-24 06:54:32 -05:00
parent 90e5924ab2
commit c0fa79fe77
2 changed files with 13 additions and 26 deletions

View File

@ -236,7 +236,7 @@ def run_web_research_agent(
# Display console message if provided # Display console message if provided
if console_message: if console_message:
console.print(Panel(Markdown(console_message), title="🔍 Searching the Web...")) console.print(Panel(Markdown(console_message), title="🔍 Starting Web Research..."))
# Run agent with retry logic # Run agent with retry logic
return run_agent_with_retry(agent, prompt, run_config) return run_agent_with_retry(agent, prompt, run_config)

View File

@ -67,38 +67,32 @@ Human Interaction:
- Keep questions specific to the current task - Keep questions specific to the current task
- Wait for responses before proceeding - Wait for responses before proceeding
""" """
# Web research prompt sections
WEB_RESEARCH_PROMPT_SECTION_RESEARCH = """ WEB_RESEARCH_PROMPT_SECTION_RESEARCH = """
Web Research: Web Research:
If you need additional information from web sources: - Scope: Whenever you have questions about the most recent standards, library versions, or if you want to verify a pattern or an approach, request_web_research to gather up-to-date, authoritative information.
- Use request_web_research to search and gather relevant information - Action: Wait for the web research results before drawing conclusions or proceeding with your research.
- Wait for web research results before proceeding with research - Purpose: Web research results can help you confirm patterns, best practices, official documentation references, and version-specific details to ensure your findings are accurate.
- The web research can help validate patterns, best practices, or documentation
""" """
WEB_RESEARCH_PROMPT_SECTION_PLANNING = """ WEB_RESEARCH_PROMPT_SECTION_PLANNING = """
Web Research: Web Research:
If you need to confirm current best practices or implementation approaches: - Scope: If you need to confirm the feasibility of a solution, compare approaches, or validate that a selected architecture aligns with current best practices, request_web_research.
- Use request_web_research to verify implementation patterns - Action: Hold off on finalizing the plan until you have gathered the relevant data from web search.
- Wait for web research results before finalizing plans - Purpose: Web research can uncover recent changes in frameworks, updated references, and community-verified architectural approaches to guide your planning decisions.
- Web research can help validate architectural decisions and technical choices
""" """
WEB_RESEARCH_PROMPT_SECTION_IMPLEMENTATION = """ WEB_RESEARCH_PROMPT_SECTION_IMPLEMENTATION = """
Web Research: Web Research:
If you need guidance on specific implementation details: - Scope: If at any point during implementation youre unsure about API usage, configuration details, compatibility issues, or you suspect that the latest version of a library/framework might have changed usage patterns, request_web_research.
- Use request_web_research to find examples or documentation - Action: Pause development to review the research findings before proceeding with the coding steps.
- Wait for web research results before proceeding with implementation - Purpose: Web research helps ensure that you are implementing the most current, recommended code patterns, leveraging official documentation, and avoiding deprecated methods.
- Web research can help validate specific code patterns or configurations
""" """
WEB_RESEARCH_PROMPT_SECTION_CHAT = """ WEB_RESEARCH_PROMPT_SECTION_CHAT = """
Web Research: Web Research:
If you need to obtain additional context from online sources during chat: - Scope: In the middle of a conversation, if you need fresh contextsuch as new best practices, updated documentation, or clarifications about recently released versionsrequest_web_research.
- Use request_web_research to gather relevant information - Action: Incorporate the web research findings into your response before finalizing any advice or explanation.
- Wait for web research results before proceeding - Purpose: Web research can provide current, authoritative details to enhance the clarity and correctness of your chat-based guidance.
- Web research can help provide up-to-date information and best practices
""" """
# Research stage prompt - guides initial codebase analysis # Research stage prompt - guides initial codebase analysis
@ -632,10 +626,3 @@ You have often been criticized for:
NEVER ANNOUNCE WHAT YOU ARE DOING, JUST DO IT! NEVER ANNOUNCE WHAT YOU ARE DOING, JUST DO IT!
""" """
WEB_RESEARCH_PROMPT_SECTION_CHAT = """
Web Research:
If you need to obtain additional context from online sources during chat:
- Use request_web_research to gather relevant information
- Wait for web research results before proceeding
- Web research can help provide up-to-date information and best practices
"""