fabricatio_novel.models.scripting

This module defines the core data structures for narrative scenes and scripts.

Together, these classes form a foundation for creating structured yet flexible narrative content.

Classes

Scene

The most basic narrative unit.

Script

A sequence of scenes forming a cohesive narrative unit especially for a novel chapter.

ChapterSummary

Structured summary of a generated chapter for cross-chapter context tracking.

Module Contents

class fabricatio_novel.models.scripting.Scene(/, **data: Any)

Bases: fabricatio_capabilities.models.generic.PersistentAble, fabricatio_core.models.generic.SketchedAble, fabricatio_core.models.generic.Described

The most basic narrative unit.

tags: List[str]

free-form semantic labels for filtering, grouping, or post-processing.

prompt: str

natural language guidance for tone, style, or constraint.

description: str = None

dialogue, description, log, poem, monologue, etc.

weight: float

Relative importance for word-count allocation within the script.

append_prompt(prompt: str) Self

Add a prompt to the scene.

Parameters:

prompt (str) – The prompt to add.

classmethod with_raw_description(description: str) Self

Create a scene with only a narrative description, defaulting weight to 1.0.

class fabricatio_novel.models.scripting.Script(/, **data: Any)

Bases: fabricatio_core.models.generic.SketchedAble, fabricatio_capabilities.models.generic.PersistentAble, fabricatio_capabilities.models.generic.AsPrompt

A sequence of scenes forming a cohesive narrative unit especially for a novel chapter.

global_prompt: str

global writing guidance applied to all scenes.

scenes: List[Scene]

Ordered list of scenes. Must contain at least one scene. Sequence implies narrative flow.

rendering_template: ClassVar[str]
append_global_prompt(prompt: str) Self

Add a global prompt to the script.

Parameters:

prompt (str) – The prompt to add.

classmethod with_raw_synosis(synosis: str) Self

Create a script with a single scene containing the synopsis as narrative.

class fabricatio_novel.models.scripting.ChapterSummary(/, **data: Any)

Bases: fabricatio_core.models.generic.SketchedAble, fabricatio_capabilities.models.generic.AsPrompt

Structured summary of a generated chapter for cross-chapter context tracking.

key_events: List[str] = None

Major plot events that occurred in this chapter.

character_states: Dict[str, str] = None

Map of character name to their emotional/physical state at chapter end.

emotional_arc: str = ''

The emotional trajectory and tone shift across this chapter.

unresolved_threads: List[str] = None

Plot hooks, tensions, or questions that remain open for future chapters.

rendering_template: ClassVar[str]