fix: FALLBACK_MODEL 顶层导入(NameError 曾中断批量重评)

This commit is contained in:
hmo
2026-07-22 01:31:56 +08:00
parent 6cdcd3f2e5
commit c27388681c
+2 -3
View File
@@ -16,7 +16,7 @@ from datetime import datetime
# ── 共享 LLM 客户端 + DB 工具(profile-scripts 硬链到同目录)──
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, "/home/hmo/MoFin")
from llm_client import call_llm, REASSESS_MODEL, gateway_alive, ocg_alive
from llm_client import call_llm, REASSESS_MODEL, FALLBACK_MODEL, gateway_alive, ocg_alive
from mofin_db import snapshot_strategy_history, sync_recommend_tag
DB = "/home/hmo/MoFin/data/mofin.db"
@@ -429,8 +429,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)
from llm_client import FALLBACK_MODEL as _FBM
result2 = call_llm(prompt, model=_FBM, max_tokens=4096)
result2 = call_llm(prompt, model=FALLBACK_MODEL, 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)