feat: 新增图片占位符提示词固定模板 入库时拼接

This commit is contained in:
yangshilin
2026-03-11 09:48:06 +08:00
parent c700b7a67c
commit 4ae68394c5
5 changed files with 66 additions and 10 deletions

View File

@@ -54,6 +54,7 @@ from agents.prompts.memory_prompts import (
get_creative_title_prompt,
get_narrative_prompt,
get_state_extraction_prompt,
inject_image_placeholder_template,
STAGE_TO_ORDER,
)
@@ -312,10 +313,12 @@ def generate_chapters_in_memory(
if i + batch_size < len(seg_list):
time.sleep(1)
# 入库前:占位符位置用正则匹配后拼上固定模板
content_to_save = inject_image_placeholder_template(existing_content)
results.append(GeneratedChapter(
category=stage,
title=title,
content=existing_content,
content=content_to_save,
order_index=STAGE_TO_ORDER.get(stage, 999),
source_segment_ids=all_source_ids,
))