Repeat shared context in every chunk
tests / test (push) Canceled after 0s
tests / windows-storage (push) Canceled after 0s

This commit is contained in:
2026-10-15 09:19:13 +00:00
parent 5612719c4f
commit a53651496c
3 changed files with 16 additions and 9 deletions
+7 -5
View File
@@ -106,22 +106,24 @@ def format_sequence_prompt(
``start-end s:`` lines rather than creating additional Timeline sections.
"""
sections: list[str] = []
directive = str(shared_directive or "").strip()
if directive:
sections.append(directive)
sound = str(soundscape or "").strip() or "N/A"
music_text = str(music or "").strip() or "N/A"
sections: list[str] = []
cursor = 0.0
for clip in sequence["clips"]:
duration = float(clip["duration"])
chunk_lines = [f"[{cursor:g}-{cursor + duration:g}s]"]
if directive:
chunk_lines.append(directive)
for slot in clip["slots"]:
start = float(slot["start"])
end = float(slot["end"])
chunk_lines.append(f"{start:g}-{end:g}s: {slot['text']}")
chunk_lines.append(f"overall_soundscape: {sound}")
chunk_lines.append(f"non_diegetic_music: {music_text}")
sections.append("\n".join(chunk_lines))
cursor += duration
sections.append(f"overall_soundscape: {str(soundscape or '').strip() or 'N/A'}")
sections.append(f"non_diegetic_music: {str(music or '').strip() or 'N/A'}")
return "\n\n".join(sections).strip()