fix: content quality, image format, task monitor, calendar data source, search UI & sort
This commit is contained in:
@@ -171,7 +171,7 @@ def polish_with_llm(html: str, platform: str, remaining_issues: Optional[List[Di
|
||||
|
||||
if remaining_issues:
|
||||
issues_desc = "\n".join(
|
||||
f"- [{i['type']}] {i.get('category','')}: {i.get('detail','')} (建议: {i.get('suggestion','')})"
|
||||
f"- [{i['type']}] {i.get('category','')}: {i.get('detail','')}"
|
||||
for i in remaining_issues
|
||||
)
|
||||
prompt = get_prompt("compliance_fix", issues_desc=issues_desc, html=html)
|
||||
@@ -183,7 +183,7 @@ def polish_with_llm(html: str, platform: str, remaining_issues: Optional[List[Di
|
||||
polished = strip_thinking_html(polished)
|
||||
if '<h2' in polished or '<p>' in polished:
|
||||
if len(polished) > len(html) * 0.3 and len(polished) > 100:
|
||||
if not any(kw in polished[:100] for kw in ['保留', '建议', '可以', '应该', '推荐']):
|
||||
if not any(kw in polished for kw in ['保留', '建议', '可以', '应该', '推荐', '改为', '替换为']):
|
||||
tag = "针对性修复" if remaining_issues else "常规润色"
|
||||
return polished, f"LLM {tag}"
|
||||
logger.warning(f"LLM 优化输出异常(过短或含建议性文字),保留原文 (len={len(polished)})")
|
||||
@@ -316,7 +316,7 @@ def main(topic_ids: List[str] = None):
|
||||
|
||||
for tid, scores in passed_scores.items():
|
||||
avg_score = sum(scores) // len(scores)
|
||||
update_topic_status(tid, 'ready', compliance_score=avg_score)
|
||||
update_topic_status(tid, 'ready', compliance_score=avg_score, reviewed_at=datetime.datetime.now())
|
||||
logger.info(f"选题 {tid} 状态 → ready(待发布), 合规分={avg_score}")
|
||||
|
||||
report_file = DRAFTS_DIR / TODAY / "optimization_report.json"
|
||||
|
||||
Reference in New Issue
Block a user