fabricatio_novel.actions.novel_mental

Mental state-aware novel generation actions.

These actions use NovelComposeMental to inject psychological state tracking into the novel generation pipeline. Characters are seeded with mental states from their CharacterCard, and states evolve after each chapter.

Classes

GenerateNovelMental

One-step novel generation with mental state tracking.

GenerateChaptersFromScriptsWithMental

Generate chapters with mental state injection and evolution.

GenerateNovelMentalRAG

One-step novel generation with RAG writing styles + mental state tracking.

GenerateChaptersFromScriptsWithMentalRAG

Generate chapters with RAG writing style injection + mental state tracking.

Module Contents

class fabricatio_novel.actions.novel_mental.GenerateNovelMental(/, **data: Any)

Bases: fabricatio_novel.capabilities.novel_mental.NovelComposeMental, fabricatio_core.Action

One-step novel generation with mental state tracking.

Calls compose_novel which seeds mental states, generates chapters with state injection, and evolves states after each chapter.

novel_outline: str | None = None

The prompt used to generate the novel.

novel_language: str | None = None

The language of the novel.

chapter_guidance: str | None = None

Guidance for writing chapter.

output_key: str = 'novel'

Key under which the generated novel will be stored in context.

ctx_override: ClassVar[bool] = True

Whether to override the instance attr by the context variable.

class fabricatio_novel.actions.novel_mental.GenerateChaptersFromScriptsWithMental(/, **data: Any)

Bases: fabricatio_novel.capabilities.novel_mental.NovelComposeMental, fabricatio_core.Action

Generate chapters with mental state injection and evolution.

Seeds mental states from character cards, generates chapters with psychological context injected into prompts, and evolves states after each chapter summary.

novel_draft: fabricatio_novel.models.draft.NovelDraft | None = None

The novel draft (for language, metadata).

novel_scripts: List[fabricatio_novel.models.scripting.Script] | None = None

The list of chapter scripts to expand into full text.

novel_characters: List[fabricatio_character.models.character.CharacterCard] | None = None

The list of characters to provide context and seed mental states.

chapter_guidance: str | None = None

Guidance for writing chapter.

output_key: str = 'novel_chapter_contents'

Key under which the generated chapter contents will be stored in context.

ctx_override: ClassVar[bool] = True

Whether to override the instance attr by the context variable.

class fabricatio_novel.actions.novel_mental.GenerateNovelMentalRAG(/, **data: Any)

Bases: fabricatio_novel.capabilities.novel_mental_rag.NovelComposeMentalRAG, fabricatio_core.Action

One-step novel generation with RAG writing styles + mental state tracking.

novel_outline: str | None = None

The prompt used to generate the novel.

novel_language: str | None = None

The language of the novel.

chapter_guidance: str | None = None

Guidance for writing chapter.

output_key: str = 'novel'

Key under which the generated novel will be stored in context.

ctx_override: ClassVar[bool] = True

Whether to override the instance attr by the context variable.

class fabricatio_novel.actions.novel_mental.GenerateChaptersFromScriptsWithMentalRAG(/, **data: Any)

Bases: fabricatio_novel.capabilities.novel_mental_rag.NovelComposeMentalRAG, fabricatio_core.Action

Generate chapters with RAG writing style injection + mental state tracking.

Seeds mental states, does RAG style injection into scripts, then generates chapters with both augmented styles and psychological context.

novel_draft: fabricatio_novel.models.draft.NovelDraft | None = None

The novel draft (for language, metadata).

novel_scripts: List[fabricatio_novel.models.scripting.Script] | None = None

The list of chapter scripts to expand into full text.

novel_characters: List[fabricatio_character.models.character.CharacterCard] | None = None

The list of characters to provide context and seed mental states.

chapter_guidance: str | None = None

Guidance for writing chapter.

writing_style_fetch_config: fabricatio_novel.models.novel_rag.WritingStyleFetchConfig | None = None

Optional fetch configuration override for writing style retrieval.

use_reranker: bool = False

When True, embedding search fetches limit * rerank_scale_factor docs, then reranks to limit.

output_key: str = 'novel_chapter_contents'

Key under which the generated chapter contents will be stored in context.

ctx_override: ClassVar[bool] = True

Whether to override the instance attr by the context variable.