feat: LLM并发模式统一——batch_reassess/trade_capture加concurrent=True(盘前批量4worker不再全压同一key,router round-robin分key), parallel_batch worker 4→6(6 key用满)
This commit is contained in:
@@ -998,7 +998,7 @@ def process_stock(code, force_today=False):
|
||||
prompt = build_prompt(data)
|
||||
|
||||
# ── 使用共享 LLM 客户端(替代 curl subprocess)──
|
||||
result = call_llm(prompt, model=REASSESS_MODEL, max_tokens=None) # 文档: 推理模型不指定max_tokens
|
||||
result = call_llm(prompt, model=REASSESS_MODEL, max_tokens=None, concurrent=True) # 2026-08-24 并发模式: router round-robin分key(4worker不再全压同一key)
|
||||
|
||||
if not result["ok"] or not (result.get("content") or "").strip():
|
||||
print(f" \u274c LLM调用失败或空输出: {result.get('error') or 'empty content'}")
|
||||
@@ -1012,7 +1012,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=None) # 文档: 推理模型不指定max_tokens
|
||||
result2 = call_llm(prompt, model=FALLBACK_MODEL, max_tokens=None, concurrent=True) # 2026-08-24 并发模式
|
||||
if result2["ok"] and len((result2.get("content") or "").strip()) > len(full_text):
|
||||
full_text = result2["content"]
|
||||
parsed = parse_response(full_text)
|
||||
|
||||
Reference in New Issue
Block a user