From 2cbc830004f8529c64062d921c42a88d5d8ec29e Mon Sep 17 00:00:00 2001 From: gahusb Date: Sun, 31 May 2026 22:21:54 +0900 Subject: [PATCH] =?UTF-8?q?feat(agent-office):=20stock=20holdings=20run/br?= =?UTF-8?q?ief=20=ED=94=84=EB=A1=9D=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- agent-office/app/service_proxy.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/agent-office/app/service_proxy.py b/agent-office/app/service_proxy.py index 30408f5..c8b0886 100644 --- a/agent-office/app/service_proxy.py +++ b/agent-office/app/service_proxy.py @@ -88,6 +88,28 @@ async def scrape_stock_news() -> Dict[str, Any]: resp.raise_for_status() 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]: resp = await _client.post(f"{MUSIC_LAB_URL}/api/music/generate", json=payload) resp.raise_for_status()