From d92d6ba54bbb1dd634fca64f2a281657c894ca49 Mon Sep 17 00:00:00 2001 From: hmo Date: Wed, 22 Jul 2026 00:36:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=88=AA=E6=96=AD=E4=BF=9D=E6=8A=A4?= =?UTF-8?q?=E2=80=94=E2=80=94=E8=BE=93=E5=87=BA<1500=E5=AD=97=E4=B8=94?= =?UTF-8?q?=E6=97=A0=E4=BF=A1=E5=8F=B7=E6=97=B6=E5=8D=87=E7=BA=A7pro?= =?UTF-8?q?=E9=87=8D=E8=AF=95=EF=BC=88flash=E6=87=92=E7=AD=94/=E6=88=AA?= =?UTF-8?q?=E6=96=AD=E5=AF=BC=E8=87=B4=E4=BF=A1=E5=8F=B7=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 53c0005a..1624247e 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -421,6 +421,17 @@ def process_stock(code, force_today=False): print(f" \u2705 LLM返回({len(full_text)}字, {result['elapsed']:.1f}s, 尝试{result['attempts']}次)", flush=True) parsed = parse_response(full_text) + + # ── 截断保护:输出过短且无信号 = 低质输出,升级 pro 重试一次 ── + if not parsed.get("signal") and len(full_text) < 1500: + print(f" ⚠️ 输出截断({len(full_text)}字)且无信号,升级 {FALLBACK_MODEL} 重试...", flush=True) + from llm_client import FALLBACK_MODEL as _FBM + result2 = call_llm(prompt, model=_FBM, max_tokens=4096) + if result2["ok"] and len((result2.get("content") or "").strip()) > len(full_text): + full_text = result2["content"] + parsed = parse_response(full_text) + print(f" \u2705 升级后({len(full_text)}字)", flush=True) + print(f" 信号={parsed['signal']} 区间={parsed['entry_low']}~{parsed['entry_high']} 损={parsed['stop_loss']} 盈={parsed['take_profit']} 仓位={parsed['position']}") save_result(code, full_text, parsed)