fix: batch_reassess按文档去掉显式max_tokens=4096(改None不指定)

This commit is contained in:
xxm
2026-08-17 11:48:49 +08:00
parent ff39dbcfa9
commit 7eb2a9ee99
+2 -2
View File
@@ -619,7 +619,7 @@ def process_stock(code, force_today=False):
prompt = build_prompt(data)
# ── 使用共享 LLM 客户端(替代 curl subprocess)──
result = call_llm(prompt, model=REASSESS_MODEL, max_tokens=4096)
result = call_llm(prompt, model=REASSESS_MODEL, max_tokens=None) # 文档: 推理模型不指定max_tokens
if not result["ok"] or not (result.get("content") or "").strip():
print(f" \u274c LLM调用失败或空输出: {result.get('error') or 'empty content'}")
@@ -633,7 +633,7 @@ def process_stock(code, force_today=False):
# ── 截断保护:输出过短且无信号 = 低质输出,升级 pro 重试一次 ──
if not parsed.get("signal") and len(full_text) < 1500:
print(f" ⚠️ 输出截断({len(full_text)}字)且无信号,升级 {FALLBACK_MODEL} 重试...", flush=True)
result2 = call_llm(prompt, model=FALLBACK_MODEL, max_tokens=4096)
result2 = call_llm(prompt, model=FALLBACK_MODEL, max_tokens=None) # 文档: 推理模型不指定max_tokens
if result2["ok"] and len((result2.get("content") or "").strip()) > len(full_text):
full_text = result2["content"]
parsed = parse_response(full_text)