The operation was aborted due to timeout 13:14:57 [ws] ⇄ res ✓ chat.history 3744...
错误信息
13:14:33 [model-pricing] LiteLLM pricing fetch failed (timeout 30s): TimeoutError: The operation was aborted due to timeout
13:14:57 [ws] ⇄ res ✓ chat.history 37446ms conn=90285579…4468 id=d4725c83…7145
13:14:57 [ws] ⇄ res ✓ node.list 23231ms conn=90285579…4468 id=e13336fe…0894
13:14:59 [feishu] feishu[main]: dropping duplicate event for message om_x100b51db42dbe0b8b3c6d2bb7a30e1b
13:15:00 [feishu] feishu[main]: received message from ou_f48bdea3ace3ef7548b27c535a3e276c in oc_26d6fd8747547c7739012ec65695f9c7 (p2p)
13:15:00 [feishu] feishu[main]: Feishu[main] DM from ou_f48bdea3ace3ef7548b27c535a3e276c: 你是什么模型
13:15:00 [feishu] feishu[main]: dispatching to agent (session=agent:main:feishu:direct:ou_f48bdea3ace3ef7548b27c535a3e276c)
13:15:00 [feishu] feishu[main]: dispatch complete (queuedFinal=false, replies=0)
13:15:02 [agent/embedded] embedded run agent end: runId=fbd004eb-f3c7-43fa-9401-0ee4a392692c isError=true model=deepseek-v4-pro-guan provider=dmxapi error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 The `reasoning_content` in the thinking mode must be passed back to the API.
13:15:02 [agent/embedded] embedded run failover decision: runId=fbd004eb-f3c7-43fa-9401-0ee4a392692c stage=assistant decision=surface_error reason=format from=dmxapi/deepseek-v4-pro-guan profile=- rawError=400 The `reasoning_content` in the thinking mode must be passed back to the API.
13:15:06 [agent/embedded] embedded run agent end: runId=a52935eb-5208-4683-9629-6f73aa343c93 isError=true model=deepseek-v4-pro-guan provider=dmxapi error=LLM request failed: provider rejected the request schema or tool payload. rawError=400 The `reasoning_content` in the thinking mode must be passed back to the API.
13:15:06 [agent/embedded] embedded run failover decision: runId=a52935eb-5208-4683-9629-6f73aa343c93 stage=assistant decision=surface_error reason=format from=dmxapi/deepseek-v4-pro-guan profile=- rawError=400 The `reasoning_content` in the thinking mode must be passed back to the API.
AI 解决方案
报错分析报告
1.错误翻译
原文:The `reasoning_content` in the thinking mode must be passed back to the API.
译文:思考模式下的`reasoning_content`必须传回API。
2. 原因分析
reasoning_content字段传回API,违反提供商请求格式要求。embedded run agent阶段向dmxapi/deepseek-v4-pro-guan发起LLM请求时,请求负载缺少reasoning_content或未按规则传递。3.解决方案
# 修复后的代码示例(以Python调用DMXAPI为例)
import requests
API_URL = "https://api.dmxapi.com/v1/chat/completions"
HEADERS = {
"Authorization": "Bearer YOUR_DMXAPI_KEY",
"Content-Type": "application/json"
}
def call_deepseek_with_thinking(prompt: str):
# 1. 构造含思考模式的请求(需包含reasoning_content占位或传递)
payload = {
"model": "deepseek-v4-pro-guan",
"messages": [{"role": "user", "content": prompt}],
"thinking_mode": True, # 启用思考模式
"response_format": {"type": "json_object"} # 强制返回结构化数据
}
# 2. 发送请求并获取含reasoning_content的响应
resp = requests.post(API_URL, headers=HEADERS, json=payload)
resp.raise_for_status()
result = resp.json()
# 3. 关键:将reasoning_content传回API(示例为后续对话场景)
followup_payload = {
"model": "deepseek-v4-pro-guan",
"messages": [
{"role": "user", "content": prompt},
{
"role": "assistant",
"content": result["choices"][0]["message"]["content"],
# 必须传回思考模式生成的reasoning_content
"reasoning_content": result["choices"][0]["message"].get("reasoning_content", "")
}
],
"thinking_mode": True
}
# 4. 发送修正后的请求
final_resp = requests.post(API_URL, headers=HEADERS, json=followup_payload)
return final_resp.json()
# 使用示例
try:
response = call_deepseek_with_thinking("解释量子计算的基本原理")
print(response)
except Exception as e:
print(f"请求失败: {e}")
4. 预防措施
reasoning_content的传递规则(如必须包含在assistant角色消息中)。reasoning_content)存在。 - 推荐工具:[Pydantic](https://docs.pydantic.dev/)(Python)、[AJV](https://ajv.js.org/)(JS)。
---
注:若需进一步调试,可提供完整请求代码片段。