feat(agent-office): stock holdings run/brief 프록시

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:21:54 +09:00
parent d0c057358a
commit 2cbc830004

View File

@@ -88,6 +88,28 @@ async def scrape_stock_news() -> Dict[str, Any]:
resp.raise_for_status() resp.raise_for_status()
return resp.json() return resp.json()
async def stock_holdings_run() -> Dict[str, Any]:
"""보유종목 시그널 계산 트리거 (EOD, use_llm=True).
stock BackgroundTask 등록 후 즉시 {ok, queued} 반환.
실제 계산은 stock 컨테이너 백그라운드에서 진행 — 여유있게 120s.
"""
async with httpx.AsyncClient(timeout=120.0) as client:
resp = await client.post(
f"{STOCK_URL}/api/stock/holdings/intel/run",
params={"use_llm": True},
)
resp.raise_for_status()
return resp.json()
async def stock_holdings_brief() -> Dict[str, Any]:
"""보유종목 최신 브리핑 payload 조회 (GET, 모듈 레벨 _client 사용)."""
resp = await _client.get(f"{STOCK_URL}/api/stock/holdings/intel")
resp.raise_for_status()
return resp.json()
async def generate_music(payload: dict) -> Dict[str, Any]: async def generate_music(payload: dict) -> Dict[str, Any]:
resp = await _client.post(f"{MUSIC_LAB_URL}/api/music/generate", json=payload) resp = await _client.post(f"{MUSIC_LAB_URL}/api/music/generate", json=payload)
resp.raise_for_status() resp.raise_for_status()