ferferefer commited on
Commit
ddec9ff
·
verified ·
1 Parent(s): 68083c8

Upload tasks.py

Browse files
Files changed (1) hide show
  1. tasks.py +127 -0
tasks.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Task
2
+
3
+ def get_research_task(agent, topic):
4
+ return Task(
5
+ description=f"""Research the topic "{topic}" extensively using PMC and Google Scholar.
6
+
7
+ Follow these steps:
8
+ 1. First search PMC using the pmc_search tool (collect at least 15 articles)
9
+ 2. Then search Google Scholar using the google_scholar_search tool (collect remaining articles to reach 20+)
10
+ 3. If not enough articles found, try:
11
+ - Different search terms related to the topic
12
+ - Broader search terms
13
+ - Related topics or subtopics
14
+ 4. CONTINUE SEARCHING UNTIL YOU HAVE AT LEAST 20 UNIQUE, RELEVANT ARTICLES
15
+
16
+ For each source, carefully extract and analyze:
17
+ - Title
18
+ - Authors (full names for APA citation)
19
+ - Publication year
20
+ - Journal name (for APA citation)
21
+ - Volume/Issue (if available)
22
+ - DOI or URL (if available)
23
+ - Key findings from abstract
24
+ - Methodology used
25
+ - Outcomes reported
26
+
27
+ Combine and synthesize the information:
28
+ - Identify common themes
29
+ - Note conflicting findings
30
+ - Highlight strongest evidence
31
+
32
+ Organize findings by:
33
+ - Study type (RCT, cohort, etc.)
34
+ - Sample size
35
+ - Follow-up duration
36
+ - Outcome measures
37
+
38
+ Output Format:
39
+ 1. Summary of search strategy
40
+ 2. Overview of findings
41
+ 3. Detailed analysis of key studies
42
+ 4. Evidence synthesis
43
+ 5. Knowledge gaps identified
44
+ 6. Complete reference list with:
45
+ - Numbered references [1], [2], etc.
46
+ - APA format for each reference
47
+ - Minimum of 20 references
48
+ Format: [N] Author(s) (Year). Title. Journal, Volume(Issue), Pages. DOI/URL
49
+ Example: [1] Smith, J. D., & Jones, M. R. (2023). Study findings. Journal of Medicine, 45(2), 123-145. https://doi.org/10.1000/med.2023""",
50
+ agent=agent,
51
+ expected_output="A comprehensive research summary with at least 20 numbered references in APA format."
52
+ )
53
+
54
+ def get_writing_task(agent, topic):
55
+ return Task(
56
+ description=f"""Write a comprehensive scientific paper about "{topic}" based on the research provided.
57
+
58
+ Paper Structure:
59
+ 1. Introduction (500-750 words):
60
+ - Current state of knowledge
61
+ - Clinical significance
62
+ - Research gaps
63
+ - Clear objectives
64
+ - MUST include at least 8 in-text citations with reference numbers [1], [2], etc.
65
+
66
+ 2. Materials and Methods (500-750 words):
67
+ - Search strategy
68
+ - Inclusion criteria
69
+ - Data extraction process
70
+ - Quality assessment
71
+ - MUST include at least 5 methodology citations with reference numbers
72
+
73
+ 3. Results (MINIMUM 1000 words):
74
+ - Study characteristics
75
+ - Patient demographics
76
+ - Primary outcomes
77
+ - Secondary outcomes
78
+ - Safety data
79
+ - Meta-analysis if applicable
80
+ - Include specific data from at least 10 studies
81
+ - MUST cite EVERY finding with reference numbers [N]
82
+ - MINIMUM 12 unique citations in this section
83
+
84
+ 4. Discussion (MINIMUM 1000 words):
85
+ - Summary of main findings
86
+ - Comparison with existing literature
87
+ - Clinical implications
88
+ - Strengths and limitations
89
+ - Future research directions
90
+ - MUST include at least 15 in-text citations with reference numbers
91
+ - Compare and contrast findings from different studies
92
+ - Address conflicting results
93
+ - Discuss potential mechanisms
94
+
95
+ 5. Conclusion (250-500 words):
96
+ - Key takeaways
97
+ - Clinical recommendations
98
+ - Research priorities
99
+ - Include 2-3 key citations with reference numbers
100
+
101
+ 6. References:
102
+ - List ALL cited articles (MINIMUM 20)
103
+ - Number each reference [1], [2], etc.
104
+ - Use proper APA format
105
+ - Include DOI/URL when available
106
+ - Alphabetical order by first author's surname
107
+ Format: [N] Author(s) (Year). Title. Journal, Volume(Issue), Pages. DOI/URL
108
+
109
+ Citation Guidelines:
110
+ - Use numbered citations [N] throughout the text
111
+ - Single reference: [1] or [2]
112
+ - Multiple references: [1,2] or [1-3]
113
+ - EVERY paragraph must have at least two citations
114
+ - EVERY major claim needs a citation
115
+ - Cite the most relevant and recent studies
116
+ - Distribute citations across ALL sections
117
+
118
+ IMPORTANT REQUIREMENTS:
119
+ - MINIMUM 20 unique references
120
+ - EVERY section must have citations
121
+ - Use numbered references [N] consistently
122
+ - Include proper APA formatting
123
+ - Check that all in-text citations have corresponding numbered references
124
+ - Verify that reference numbers match between in-text citations and reference list""",
125
+ agent=agent,
126
+ expected_output="A well-structured scientific paper with comprehensive analysis, numbered citations throughout all sections, and at least 20 properly formatted references."
127
+ )