Update app.py
Browse files
app.py
CHANGED
|
@@ -199,21 +199,31 @@ def make_tasks(inputs: Dict[str, Any]) -> List[Task]:
|
|
| 199 |
)
|
| 200 |
|
| 201 |
t6 = Task(
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
|
| 218 |
return [t1, t2, t3, t4, t5, t6]
|
| 219 |
|
|
|
|
| 199 |
)
|
| 200 |
|
| 201 |
t6 = Task(
|
| 202 |
+
description=textwrap.dedent("""
|
| 203 |
+
Synthesize final portfolio and Markdown report with tables and insights.
|
| 204 |
+
Inputs: all previous JSON outputs (market_signals, sentiments, trades, risk_approval, costs)
|
| 205 |
+
Requirements:
|
| 206 |
+
1. Portfolio Summary (Markdown table: Asset | Action | Quantity | Price ($) | Approved)
|
| 207 |
+
2. Trades Executed (Markdown table: Trade ID | Action | Approved | Fee ($) | Tax ($) | Net Effect ($))
|
| 208 |
+
3. Risk Approvals (Markdown table: Trade ID | Approved | Reason)
|
| 209 |
+
4. Fees & Taxes (shown in Trades Executed table)
|
| 210 |
+
5. Insights & Recommendations:
|
| 211 |
+
- Provide 1-2 beginner-friendly bullet points per asset, explaining:
|
| 212 |
+
* Why the trade was executed or held
|
| 213 |
+
* Any risk considerations
|
| 214 |
+
* Any fee/tax impact
|
| 215 |
+
- All numeric values must be pre-computed (JSON-safe)
|
| 216 |
+
- Return STRICT JSON:
|
| 217 |
+
{
|
| 218 |
+
"final_portfolio": [...],
|
| 219 |
+
"trade_summary": [...],
|
| 220 |
+
"report_markdown": "..."
|
| 221 |
+
}
|
| 222 |
+
""").strip(),
|
| 223 |
+
agent=manager_agent,
|
| 224 |
+
expected_output="JSON only."
|
| 225 |
+
)
|
| 226 |
+
|
| 227 |
|
| 228 |
return [t1, t2, t3, t4, t5, t6]
|
| 229 |
|