Spaces:
Sleeping
Sleeping
Update core/pipeline_agent.py
Browse files187 unmodified lines188189190191192193194187 unmodified linesfull_content = ""try:with requests.post(self.deepseek_api_url, headers={"Authorization": f"Bearer {self.ds_key}"}, json=payload, stream=True, timeout=120) as response:response.raise_for_status()for line in response.iter_lines():if line and line.decode('utf-8').startswith('data: ') and line.decode('utf-8') != 'data: [DONE]':try:187 unmodified lines188189190191192193194195196197198199187 unmodified linesfull_content = ""try:with requests.post(self.deepseek_api_url, headers={"Authorization": f"Bearer {self.ds_key}"}, json=payload, stream=True, timeout=120) as response:# 🚨 如果 API 报错(如 402欠费, 401未授权, 502宕机),立刻抓取错误信息并抛到前端网页!if response.status_code != 200:error_msg = f"DeepSeek API 拒绝访问 (状态码: {response.status_code})。详情: {response.text}"st.toast(f"❌ {error_msg}", icon="🚨") # 在网页右下角弹窗报警raise requests.exceptions.HTTPError(error_msg)for line in response.iter_lines():if line and line.decode('utf-8').startswith('data: ') and line.decode('utf-8') != 'data: [DONE]':try:
core/pipeline_agent.py+6-1