v2.0.1:修复推理型模型(Qwen3/DeepSeek reasoning_content)误报未收到输出+连接测试按连通判定+采样失败不中断+流式超时放宽60s/300s
This commit is contained in:
@@ -74,8 +74,13 @@ def test_config():
|
||||
if not cfg.get("api_key"):
|
||||
return jsonify({"ok": False, "error": "请填写 API Key"}), 400
|
||||
try:
|
||||
m = call_stream(cfg, "你好,请只回复:OK", {"max_tokens": 16, "avoid_cache": False})
|
||||
return jsonify({"ok": True, "total_ms": m["total_ms"], "metrics": m})
|
||||
# 连接测试:只要流式请求成功返回(哪怕正文为空/只有思维链)都算连通
|
||||
m = call_stream(cfg, "你好,请简要回答:1+1=?",
|
||||
{"max_tokens": 32, "avoid_cache": False})
|
||||
note = ""
|
||||
if not (m.get("output_tokens") or m.get("output_chars")):
|
||||
note = "(连接正常,但本次未返回正文内容,可能为推理型模型)"
|
||||
return jsonify({"ok": True, "total_ms": m["total_ms"], "metrics": m, "note": note})
|
||||
except ProviderError as e:
|
||||
return jsonify({"ok": False, "error": str(e)})
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user