Align beat prompt with upstream Long Videos
This commit is contained in:
@@ -11,35 +11,62 @@ class DumasH3BeatPromptTests(unittest.TestCase):
|
||||
state = self.module._parse_beat_prompt_state("not json")
|
||||
self.assertEqual(
|
||||
state,
|
||||
{"beats": [{"text": "Describe this beat."}]},
|
||||
{
|
||||
"scene": "",
|
||||
"character_sheet": "",
|
||||
"beats": [{"text": "Describe this beat."}],
|
||||
},
|
||||
)
|
||||
|
||||
def test_assemble_prompt_joins_beats_with_blank_lines(self):
|
||||
def test_assemble_prompt_outputs_upstream_sections(self):
|
||||
prompt = self.module._assemble_beat_prompt(
|
||||
{
|
||||
"scene": "A rainy kitchen at night.",
|
||||
"character_sheet": "Maya: 27, she, red jacket, silver hair.",
|
||||
"beats": [
|
||||
{"text": "A woman enters the room."},
|
||||
{"text": "wardrobe: Maya = red jacket\nShe sits at the table."},
|
||||
{"text": "Maya enters the room."},
|
||||
{"text": "remove: red jacket\nadd: white shirt underneath\nShe sits at the table."},
|
||||
{"text": " "},
|
||||
{"text": "music: low synth pulse"},
|
||||
]
|
||||
}
|
||||
)
|
||||
self.assertEqual(
|
||||
prompt,
|
||||
(
|
||||
"A woman enters the room.\n\n"
|
||||
"wardrobe: Maya = red jacket\nShe sits at the table.\n\n"
|
||||
"music: low synth pulse"
|
||||
"A rainy kitchen at night.\n\n"
|
||||
"Maya: 27, she, red jacket, silver hair.\n\n"
|
||||
"Maya enters the room.\n\n"
|
||||
"remove: red jacket\nadd: white shirt underneath\nShe sits at the table."
|
||||
),
|
||||
)
|
||||
|
||||
def test_assemble_prompt_strips_old_dumas_directives(self):
|
||||
prompt = self.module._assemble_beat_prompt(
|
||||
{
|
||||
"beats": [
|
||||
{
|
||||
"text": (
|
||||
"seconds: 8\n"
|
||||
"continuity: hard cut\n"
|
||||
"ref_mode: every shot\n"
|
||||
"soundscape: soft rain\n"
|
||||
"music: low synth\n"
|
||||
"Maya opens the cupboard.\n"
|
||||
"remove: red jacket"
|
||||
)
|
||||
},
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
self.assertEqual(prompt, "Maya opens the cupboard.\nremove: red jacket")
|
||||
|
||||
def test_node_build_prompt_uses_hidden_state(self):
|
||||
node = self.module.DumasH3BeatPromptNode()
|
||||
result = node.build_prompt(
|
||||
'{"beats":[{"text":"Beat one"},{"text":"Beat two"}]}'
|
||||
'{"scene":"Scene","character_sheet":"Maya: 27, she","beats":[{"text":"Beat one"},{"text":"Beat two"}]}'
|
||||
)
|
||||
self.assertEqual(result, ("Beat one\n\nBeat two",))
|
||||
self.assertEqual(result, ("Scene\n\nMaya: 27, she\n\nBeat one\n\nBeat two",))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user