返回 VideoClaw
smart_continue.md
根目录 / video-claw / references / workflow / smart_continue.md
1 # 智能续写剧本
2
3 在完成完整视频生成后(或者任何用户觉得需要往下推进剧情的时间点),如果用户对当前故事满意并希望故事继续发展,可以请求智能续写功能。
4
5 ---
6
7 ## 阶段流程
8
9 当你需要根据已有的剧集内容,续写新的剧集时,按以下流程调用:
10
11 ### 1. 发起续写请求
12
13 发送干预(Intervene)请求回溯给 `script_generation` 阶段,并在 `modifications` 中设置 `action: "smart_continue"`:
14
15 ```bash
16 curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
17 -H "Content-Type: application/json" \
18 -d '{
19 "stage": "script_generation",
20 "modifications": {
21 "action": "smart_continue",
22 "episodes_to_add": 1,
23 "sequel_idea": "用户如果有后续主线想法可以填在此,不填空着让大模型自发散"
24 }
25 }'
26 ```
27
28 * `episodes_to_add`: 希望追加生成的剧集数量(默认1)。
29 * `sequel_idea`: 续写的一句话灵感,若为空则由模型自动生成。
30
31 ### 2. 等待生成并展示
32
33 该接口请求发起后,系统会自动根据之前的剧本记录生成新的设定、人物和新的剧集内容。完成后,获取新的 Artifact:
34
35 ```bash
36 curl "http://localhost:8000/api/project/{session_id}/artifact/script_generation"
37 ```
38 此时 `artifact` 中会多出 `new_episodes`、`new_characters`、`new_settings` 等字段。
39
40 **必须向用户发送消息**,展示:
41 1. **续写灵感**:`artifact.sequel_idea`
42 2. **新增剧情**:`artifact.new_episodes` 列表。
43 3. **新增角色和场景**(若有)。
44
45 并询问用户:“是否确认将以上续写内容并入主剧本中?”
46
47 ### 3. 确认或取消续写
48
49 等待用户反馈。如果用户:
50
51 **同意 / 满意**:合并这些续集。
52 ```bash
53 curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
54 -H "Content-Type: application/json" \
55 -d '{
56 "stage": "script_generation",
57 "modifications": {
58 "action": "confirm_continue"
59 }
60 }'
61 ```
62 (系统将在后台自动合并新老剧集数据,同步跨阶段变量等,之后你可以引导用户进行下一步或者继续看完整剧本)
63
64 **不同意 / 取消**:放弃本次续写。
65 ```bash
66 curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
67 -H "Content-Type: application/json" \
68 -d '{
69 "stage": "script_generation",
70 "modifications": {
71 "action": "delete_continue"
72 }
73 }'
74 ```
75 (系统在后台抛弃刚才的新增内容)
76
76 lines MARKDOWN