Spaces:
Sleeping
Sleeping
Update features/insight_and_tasks/agents/task_extraction_agent.py
Browse files
features/insight_and_tasks/agents/task_extraction_agent.py
CHANGED
@@ -116,88 +116,26 @@ class TaskExtractionAgent:
|
|
116 |
OUTPUT FORMAT:
|
117 |
You MUST return a single JSON object that strictly conforms to the 'TaskExtractionOutput' Pydantic schema.
|
118 |
This JSON object will contain:
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
"objective_description": "Clear, aspirational objective statement",
|
125 |
-
"key_results": [
|
126 |
{{
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
"priority": "High|Medium|Low",
|
141 |
-
"priority_justification": "Why this priority level",
|
142 |
-
"why_proposed": "Connection to analysis insights",
|
143 |
-
"task_type": "initiative|tracking",
|
144 |
-
"data_subject": "follower_stats|posts|mentions|general (or null)"
|
145 |
-
}}
|
146 |
-
]
|
147 |
}}
|
148 |
-
],
|
149 |
-
"objective_timeline": "Short-term|Medium-term|Long-term",
|
150 |
-
"objective_owner": "Team or role responsible"
|
151 |
-
}}
|
152 |
-
],
|
153 |
-
"overall_strategic_focus": "Summary of main strategic themes",
|
154 |
-
"generation_timestamp": "{datetime.utcnow().isoformat()}"
|
155 |
-
}}
|
156 |
-
|
157 |
-
## CRITICAL REQUIREMENTS:
|
158 |
-
|
159 |
-
### 1. OKR Structure (MANDATORY):
|
160 |
-
- Create 2-4 Objectives maximum
|
161 |
-
- Each Objective MUST have 2-4 Key Results
|
162 |
-
- Each Key Result MUST have 2-5 Tasks
|
163 |
-
- NO EMPTY ARRAYS - every section must contain items
|
164 |
-
|
165 |
-
### 2. Task Requirements (ALL FIELDS MANDATORY):
|
166 |
-
- task_category: Broad theme (e.g., "Content Strategy", "Audience Growth")
|
167 |
-
- task_description: Specific action statement
|
168 |
-
- objective_deliverable: Clear deliverable description
|
169 |
-
- effort: Must be exactly "Small", "Medium", or "Large"
|
170 |
-
- timeline: Must be exactly "Immediate", "Short-term", "Medium-term", or "Long-term"
|
171 |
-
- responsible_party: Specific role or team
|
172 |
-
- success_criteria_metrics: Measurable success indicators
|
173 |
-
- dependencies_prerequisites: Prerequisites or null
|
174 |
-
- priority: Must be exactly "High", "Medium", or "Low"
|
175 |
-
- priority_justification: Brief explanation for priority
|
176 |
-
- why_proposed: Direct link to analysis findings
|
177 |
-
- task_type: Must be exactly "initiative" or "tracking"
|
178 |
-
- data_subject: For tracking tasks, use "follower_stats", "posts", "mentions", or "general"; for initiatives, use "general" or null
|
179 |
-
|
180 |
-
### 3. Key Result Requirements:
|
181 |
-
- key_result_description: Specific, measurable outcome
|
182 |
-
- target_metric: The metric being measured (required)
|
183 |
-
- target_value: The target to achieve (required)
|
184 |
-
- tasks: Array of tasks (minimum 2 tasks per key result)
|
185 |
-
|
186 |
-
### 4. Timeline Considerations:
|
187 |
-
Given {days_remaining} days left in Q{quarter}:
|
188 |
-
- "Immediate": 1-2 weeks
|
189 |
-
- "Short-term": Rest of current quarter
|
190 |
-
- "Medium-term": Next quarter (3-6 months)
|
191 |
-
- "Long-term": 6+ months
|
192 |
-
|
193 |
-
### 5. Task Type Guidelines:
|
194 |
-
- "initiative": New projects, campaigns, process changes
|
195 |
-
- "tracking": Monitoring, measurement, ongoing analysis
|
196 |
-
|
197 |
-
### 6. Priority Assignment Logic:
|
198 |
-
- High: Critical for quarter goals, high impact, urgent
|
199 |
-
- Medium: Important but not critical, moderate impact
|
200 |
-
- Low: Nice to have, low impact, can be delayed
|
201 |
Focus on quality, actionability, and strict adherence to the output schema.
|
202 |
"""
|
203 |
|
|
|
116 |
OUTPUT FORMAT:
|
117 |
You MUST return a single JSON object that strictly conforms to the 'TaskExtractionOutput' Pydantic schema.
|
118 |
This JSON object will contain:
|
119 |
+
- 'current_quarter_info': A string exactly like "Q{quarter}, {days_remaining} days remaining". (This is fixed based on the context above).
|
120 |
+
- 'okrs': A list, where each item is an 'OKR' object.
|
121 |
+
- 'overall_strategic_focus': (Optional) A brief summary of the main strategic themes emerging from the OKRs.
|
122 |
+
- 'generation_timestamp': (This will be auto-filled if you conform to the schema, or you can provide an ISO timestamp).
|
123 |
+
Example of a Task (ensure all fields from the Pydantic model are covered):
|
|
|
|
|
124 |
{{
|
125 |
+
"task_category": "Content Creation",
|
126 |
+
"task_description": "Launch a 3-part blog series on AI in Marketing.",
|
127 |
+
"objective_deliverable": "Objective: Increase thought leadership in AI marketing. Deliverable: 3 published blog posts.",
|
128 |
+
"effort": "Medium",
|
129 |
+
"timeline": "Short-term",
|
130 |
+
"responsible_party": "Content Team Lead",
|
131 |
+
"success_criteria_metrics": "Average 500 views per post, 10+ shares per post.",
|
132 |
+
"dependencies_prerequisites": "Keyword research for AI marketing topics completed.",
|
133 |
+
"priority": "High",
|
134 |
+
"priority_justification": "Addresses key strategic goal of establishing AI expertise.",
|
135 |
+
"why_proposed": "Analysis highlighted a gap in content related to AI, a high-interest area for our target audience.",
|
136 |
+
"task_type": "initiative",
|
137 |
+
"data_subject": "general"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
Focus on quality, actionability, and strict adherence to the output schema.
|
140 |
"""
|
141 |
|