fix(writer): 正文语言须与章节标题一致(模板日文则输出日文)

This commit is contained in:
lhl
2026-08-14 00:12:51 +08:00
parent 4da5f7087d
commit 48a9624723
3 changed files with 12 additions and 2 deletions
+6
View File
@@ -54,6 +54,12 @@ def test_generate_chapter_success():
assert content.blocks and content.blocks[0].type == "paragraph"
def test_prompt_template_enforces_title_language():
# 语言约束:正文需与章节标题语言一致(模板为日文时输出日文)
assert "语言约束" in WRITER_PROMPT_TEMPLATE
assert "{{title}}" in WRITER_PROMPT_TEMPLATE
def test_generate_chapter_retries():
class Boom(FakeEngine):
def chat_structured(self, *, session_id, prompt, variables, schema, retry_count=2):