from crewai import Task def get_research_task(agent, topic): return Task( description=f"""Research the topic "{topic}" extensively using PMC and Google Scholar. Follow these steps: 1. First search PMC using the pmc_search tool 2. Then search Google Scholar using the google_scholar_search tool 3. For each source, carefully extract and analyze: - Title - Authors - Publication year - Key findings from abstract - Methodology used - Outcomes reported 4. Combine and synthesize the information: - Identify common themes - Note conflicting findings - Highlight strongest evidence 5. Organize findings by: - Study type (RCT, cohort, etc.) - Sample size - Follow-up duration - Outcome measures If search results are limited: 1. Try alternative search terms 2. Broaden the search scope 3. Include related conditions/treatments Output Format: 1. Summary of search strategy 2. Overview of findings 3. Detailed analysis of key studies 4. Evidence synthesis 5. Knowledge gaps identified""", agent=agent, expected_output="A comprehensive research summary with detailed analysis of findings from both PMC and Google Scholar." ) def get_writing_task(agent, topic): return Task( description=f"""Write a comprehensive scientific paper about "{topic}" based on the research provided. Paper Structure: 1. Introduction: - Current state of knowledge - Clinical significance - Research gaps - Clear objectives 2. Materials and Methods: - Search strategy - Inclusion criteria - Data extraction process - Quality assessment 3. Results (minimum one page): - Study characteristics - Patient demographics - Primary outcomes - Secondary outcomes - Safety data - Meta-analysis if applicable 4. Discussion (minimum one page): - Summary of main findings - Comparison with existing literature - Clinical implications - Strengths and limitations - Future research directions 5. Conclusion: - Key takeaways - Clinical recommendations - Research priorities 6. References: - APA format - All cited studies included Writing Guidelines: - Use clear, scientific language - Support all claims with evidence - Include relevant statistics - Maintain objectivity - Address conflicting findings - Consider clinical relevance""", agent=agent, expected_output="A well-structured scientific paper with comprehensive analysis and proper citations." )