Merge pull request #140 from aiastia-dockerhub/fix/duplicate-writing-style-injection
fix: 修复写作风格在章节生成时被重复注入的问题
This commit is contained in:
@@ -11,15 +11,18 @@ class WritingStyleManager:
|
|||||||
"""
|
"""
|
||||||
将写作风格应用到基础提示词中
|
将写作风格应用到基础提示词中
|
||||||
|
|
||||||
|
注意:写作风格已通过 system_prompt 注入(system_prompt_with_style),
|
||||||
|
此方法仅追加输出指令,不再重复注入 style_content,避免风格信息被注入两次。
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
base_prompt: 基础提示词
|
base_prompt: 基础提示词
|
||||||
style_content: 风格要求内容
|
style_content: 风格要求内容(已通过 system_prompt 注入,此处不使用)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
组合后的提示词
|
追加输出指令后的提示词
|
||||||
"""
|
"""
|
||||||
# 在基础提示词末尾添加风格要求
|
# 写作风格已在 system_prompt 中注入,此处只追加输出格式指令
|
||||||
return f"{base_prompt}\n\n{style_content}\n\n请直接输出章节正文内容,不要包含章节标题和其他说明文字。"
|
return f"{base_prompt}\n\n请直接输出章节正文内容,不要包含章节标题和其他说明文字。"
|
||||||
|
|
||||||
|
|
||||||
class PromptService:
|
class PromptService:
|
||||||
|
|||||||
Reference in New Issue
Block a user