fix: parse_response买入区0.0~0.0视为zone_cleared(elif)——清空脏值不残留

This commit is contained in:
xxm
2026-08-18 11:06:16 +08:00
parent 31f3da772d
commit 01a60653f8
+2 -5
View File
@@ -458,11 +458,8 @@ def parse_response(text):
if zl:
if re.search(r'\s*(无|不设|不参与|空仓)', zl):
result["zone_cleared"] = True
else:
# 2026-08-18 修复:LLM 输出"买入区0.0~0.0"也视为 zone_cleared(清空)
# 否则 parse 得 0/0 → 区间条件不成立 → 旧脏值(如95/99)残留(600262 教训)
_zero_nums = re.findall(r'\d+\.?\d*', zl)
if len(_zero_nums) >= 2 and all(float(n) <= 0.01 for n in _zero_nums[:2]):
elif len(re.findall(r'\d+\.?\d*', zl)) >= 2 and all(float(n) <= 0.01 for n in re.findall(r'\d+\.?\d*', zl)[:2]):
# 2026-08-18 修复:LLM 输出"买入区0.0~0.0"也视为 zone_cleared(清空脏值
result["zone_cleared"] = True
else:
# 2026-08-18 修复:LLM 说"95~99(异常,应为14.87~15.01"时,取"应为"后的正确区间