feat(agent-office): 주식 브리핑 본문에 주요 뉴스 헤드라인+링크 추가

- stock-lab /news/summarize 응답에 top 8 기사(title/link/press) 포함
- agent-office stock.py: _build_briefing_body() 헬퍼 분리 — LLM 요약 + 📰 주요 뉴스 섹션(HTML <a> 링크). 향후 본문 고도화 시 이 함수만 수정
- telegram 포맷터/메시징에 body_is_html 플래그 추가 (링크 포함 메시지는 이중 escape 회피)
- 아내 전송도 동일 본문 재사용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-15 00:56:20 +09:00
parent b867b8ce13
commit b23346143f
4 changed files with 59 additions and 5 deletions

View File

@@ -167,9 +167,20 @@ async def summarize_latest_news(req: NewsSummarizeRequest = NewsSummarizeRequest
logger.exception("뉴스 요약 중 예상치 못한 오류")
raise HTTPException(status_code=500, detail=f"뉴스 요약 실패: {e}")
# 상위 기사 메타 일부만 노출 (클라이언트가 본문 조립에 사용)
top_articles = [
{
"title": (a.get("title") or "").strip(),
"link": a.get("link") or "",
"press": a.get("press") or "",
"pub_date": a.get("pub_date") or "",
}
for a in articles[:8]
]
return {
**result,
"article_count": len(articles),
"articles": top_articles,
}
# --- Trading API (Windows Proxy, 인증 필요) ---