From 3d3d16ac0371a8e42c59ee8284a662914f275722 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Wed, 03 Jun 2026 11:32:13 +0800
Subject: [PATCH] Add a mechanism for detecting and repairing the number of plot episodes

---
 video-claw/video-claw/backend/prompts/script/generate_script_en.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/video-claw/video-claw/backend/prompts/script/generate_script_en.txt b/video-claw/video-claw/backend/prompts/script/generate_script_en.txt
index f082af4..178126e 100644
--- a/video-claw/video-claw/backend/prompts/script/generate_script_en.txt
+++ b/video-claw/video-claw/backend/prompts/script/generate_script_en.txt
@@ -1,7 +1,7 @@
 You are an expert micro-drama screenwriter. Based on the user's "core inspiration" and "story style," directly create a complete micro-drama script.
 
 [Script Format]:
-1. **Episodic Structure and Length**: The script must be divided into episodes (e.g., "## Episode 1", "## Episode 2"...). Each episode must contain 25-30 action/dialogue lines, recommended 26-29 lines, and must NEVER exceed 30 action/dialogue lines. Episode headings, scene headings, and character-list lines do not count toward this limit. Do not output character bios, outlines, or prefaces. Directly output the script text starting from "## Episode 1".
+1. **Episodic Structure and Length**: You MUST output exactly the requested number of episodes. Do not output fewer episodes, do not output extra episodes, and do not merge multiple episodes into one. If the requested count is N, output consecutive headings from "## Episode 1" through "## Episode N", and every episode must contain complete script content. Each episode must contain 25-30 action/dialogue lines, recommended 26-29 lines, and must NEVER exceed 30 action/dialogue lines. Episode headings, scene headings, and character-list lines do not count toward this limit. Do not output character bios, outlines, or prefaces. Directly output the script text starting from "## Episode 1".
 2. **Scene and Industrial Layout**:
    - Each scene must begin with a bold, centered scene heading format: `**a-b Day/Night Int/Ext Scene Name**` ('a' is the episode number, 'b' is the scene sequence).
    - Below the heading, exactly one line should specify: `Characters: xxx, xxx`, followed by one blank line.
@@ -37,4 +37,4 @@
 
 ---
 
-Now, begin your creation. Based on the [User Core Inspiration/Story Setting], output the complete script text containing {episodes} episodes. Before outputting, self-check the action/dialogue line count of every episode. If any episode exceeds 30 action/dialogue lines, delete side beats, repeated reactions, or optional scenes instead of turning dialogue into unnatural short fragments. Only output the complete script; no additional commentary or preface is required.
+Now, begin your creation. Based on the [User Core Inspiration/Story Setting], output the complete script text containing exactly {episodes} episodes, with consecutive headings from "## Episode 1" through "## Episode {episodes}". Before outputting, self-check: 1) the episode count is exactly {episodes}; 2) episode numbers are consecutive from 1 to {episodes}; 3) every episode has 25-30 action/dialogue lines. If any episode exceeds 30 action/dialogue lines, delete side beats, repeated reactions, or optional scenes instead of turning dialogue into unnatural short fragments. Only output the complete script; no additional commentary or preface is required.

--
Gitblit v1.8.0