Merge remote-tracking branch 'origin/development' into development

# Conflicts:
#	api/agents/prompts/memory_prompts.py
This commit is contained in:
Kevin
2026-03-11 14:29:48 +08:00
5 changed files with 65 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ from agents.prompts.memory_prompts import (
get_narrative_prompt,
get_state_extraction_prompt,
get_chapter_classification_prompt,
inject_image_placeholder_template,
STAGE_TO_ORDER,
CHAPTER_CATEGORIES,
)
@@ -522,6 +523,9 @@ def process_memoir_segments(self, user_id: str, segment_ids: List[str]):
)
narrative = f"{existing_content}\n\n{combined_text}"
# 入库前:占位符位置用正则匹配后拼上固定模板
narrative = inject_image_placeholder_template(narrative)
# 更新或创建章节
if chapter:
chapter.content = narrative
@@ -656,6 +660,9 @@ def generate_chapter_content(self, user_id: str, stage: str, new_content: str):
)
narrative = f"{existing_content}\n\n{new_content}"
# 入库前:占位符位置用正则匹配后拼上固定模板
narrative = inject_image_placeholder_template(narrative)
if chapter:
chapter.content = narrative
chapter.is_new = True