From bb4ecf37e80b8b8307b90df67167bde0945bd5aa Mon Sep 17 00:00:00 2001 From: sophie-24 Date: Mon, 3 Aug 2026 02:44:27 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=97=90=EB=9F=AC=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/clients/rag_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/clients/rag_client.py b/app/clients/rag_client.py index b69768a..305a52a 100644 --- a/app/clients/rag_client.py +++ b/app/clients/rag_client.py @@ -1,6 +1,7 @@ import httpx from app.core.config import settings + async def call_recommend(settlement, contract, net_exposure_krw, assessment, strategy_context) -> dict: payload = { "companyProfile": {"tradeDirection": contract.contract_type, "currencies": [settlement.currency], @@ -18,5 +19,7 @@ async def call_recommend(settlement, contract, net_exposure_krw, assessment, str } async with httpx.AsyncClient(base_url=settings.rag_base_url, timeout=10) as client: resp = await client.post("/recommend", json=payload) - resp.raise_for_status() + if resp.status_code >= 400: + # RAG가 준 422 detail을 그대로 로그에 남겨서 원인을 바로 보이게 함 + raise RuntimeError(f"RAG /recommend {resp.status_code} 응답: {resp.text}") return resp.json() \ No newline at end of file