前后端页面同步策略,支持分析模板热编辑以及yaml配置,修改提示词编码,占用符等问题,优化文件扫描

This commit is contained in:
2026-04-20 09:50:35 +08:00
parent 00bd48e7e7
commit 3e1ecf2549
14 changed files with 539 additions and 287 deletions

View File

@@ -84,6 +84,20 @@ class LLMHelper:
else:
yaml_content = response.strip()
# Strip language identifier if LLM used ```python instead of ```yaml
# e.g. "python\naction: ..." → "action: ..."
import re
if re.match(r'^[a-zA-Z]+\n', yaml_content):
yaml_content = yaml_content.split('\n', 1)[1]
# Fix Windows backslash paths that break YAML double-quoted strings.
# e.g. "D:\code\iov..." → "D:/code/iov..." inside quoted values
yaml_content = re.sub(
r'"([A-Za-z]:\\[^"]*)"',
lambda m: '"' + m.group(1).replace('\\', '/') + '"',
yaml_content,
)
parsed = yaml.safe_load(yaml_content)
return parsed if parsed is not None else {}
except Exception as e: