15 lines
511 B
Python
15 lines
511 B
Python
|
|
"""
|
|||
|
|
PlaceholderInjectAgent:对 narrative 做占位符模板注入。
|
|||
|
|
对应现有逻辑:inject_image_placeholder_template
|
|||
|
|
纯函数式,无 LLM 调用。
|
|||
|
|
"""
|
|||
|
|
from app.agents.prompts.memory_prompts import inject_image_placeholder_template
|
|||
|
|
|
|||
|
|
|
|||
|
|
def inject_placeholders(content: str) -> str:
|
|||
|
|
"""
|
|||
|
|
对章节正文做占位符处理:匹配所有图片占位符,拼上固定模板。
|
|||
|
|
与 inject_image_placeholder_template 行为一致。
|
|||
|
|
"""
|
|||
|
|
return inject_image_placeholder_template(content)
|