Просмотр исходного кода

fix: add raise_for_status to expose real LLM HTTP errors

Xiaogang Liao 3 месяцев назад
Родитель
Сommit
60fcf0d57d
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      cfc-langgraph/app/agents/report_parse_agent.py

+ 1 - 0
cfc-langgraph/app/agents/report_parse_agent.py

@@ -83,6 +83,7 @@ class ReportParseAgent:
                         },
                         headers={"Authorization": f"Bearer {self.llm_api_key}"},
                     )
+                    resp.raise_for_status()
                     data = resp.json()
                     content = data['choices'][0]['message']['content']
                     content = content.replace('```json', '').replace('```', '').strip()