�
�qi� � �@ � d dl mZ d dlmZ d dlmZ ed� Zdd�Zy)� )�annotations)�Dict)�Templatea�
# {{ title }}
**Date**: {{ date }}
**Tickers**: {{ tickers|join(', ') }}
## Summary
{{ summary }}
## News (Condensed)
{% if news_summary %}{{ news_summary }}{% else %}_No news summary_
{% endif %}
## SEC Filings (Condensed)
{% if filings_summary %}{{ filings_summary }}{% else %}_No filings summary_
{% endif %}
## Scores
| Ticker | Base | Dip bonus | Total |
|---|---:|---:|---:|
{% for t in scores %}| {{ t.ticker }} | {{ '%.3f'|format(t.base_score) }} | {{ '%.3f'|format(t.dip_bonus) }} | {{ '%.3f'|format(t.score) }} |
{% endfor %}
## Factor Evidence
| Ticker | Sector | PE | PB | EPS | ROE | RevG | ProfitM | Mom(3/6/12) | Event |
|---|---|---:|---:|---:|---:|---:|---:|---:|---:|
{% for t in scores %}| {{ t.ticker }} | {{ t.sector or '' }} | {{ t.pe if t.pe is not none else '' }} | {{ t.pb if t.pb is not none else '' }} | {{ t.eps if t.eps is not none else '' }} | {{ t.returnOnEquity if t.returnOnEquity is not none else '' }} | {{ t.revenueGrowth if t.revenueGrowth is not none else '' }} | {{ t.profitMargins if t.profitMargins is not none else '' }} | {{ '%.3f/%.3f/%.3f'|format(t.mom3 or 0.0, t.mom6 or 0.0, t.mom12 or 0.0) }} | {{ '%.3f'|format(t.eventScore or 0.0) }} |
{% endfor %}
c �, � t j di | ��S )N� )�DEFAULT_TEMPLATE�render)�payloads �;/home/surplus96/projects/PM-MCP/mcp_server/tools/reports.py�generate_reportr &