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.

location: str = ''

Physical or virtual setting where this scene takes place (e.g. ‘the inner side of classroom close to the window’).

when: str = ''

Temporal setting of the scene (e.g. ‘the next morning’, ‘midnight’, ‘three days later’).

characters_present: Dict[str, str] = None

Character names mapped to their detailed acting scripts in this scene (name → what they do/how they appear).

purpose: str = ''

Narrative role of this scene.

mood: str = ''

Emotional atmosphere of the scene.

bulk_append(prompts: List[str]) Self

Append multiple prompts to the scene in a single call, joined by newlines.

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.

character_knowledge: Dict[str, List[str]] = None

Map of character name to list of facts/events they know or experienced up to this chapter.

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]