Prompt Reference

Prompts are authored using Jinja2-style syntax. Refer to the Jinja2 documentation for details:

https://jinja.palletsprojects.com/en/stable/templates/

Prompt Blocks

Prompts can include other prompts, referred to as “blocks”. This is useful to organize common formatting and logic so it can be easily reusable. To include a block, use the Jinja include function and provide the ID of the prompt to include. For example:

{% include "prompt_block_selected_character_memories" %}

Globals

You have access to a set of global variables that contain relevant data for prompt generation:

Variable Type Description
actor Actor The Actor for whom the prompt is being generated.
s Snapshot The current snapshot that contains all relevant StoryEngine state.
ra RenderAction The RenderAction that invoked the Prompt evaluation
ctx Context The context object from the Event that triggered the RenderAction. This typically contains the JSON payload from the game that emitted the event.
actions Actions MutationActions that will be applied when the tick is complete.
incidents Incident Relevant history incidents for this tick.

Types

Actor

Represents a snapshot of an actor in the system.

Methods


Location

Represents a snapshot of a location in the system.

Methods


Item

Represents a snapshot of an item in the system.

Methods


PassiveGoal

Represents a snapshot of a passive goal in the system.

Methods


ActiveGoal

Represents a snapshot of an active goal in the system.

Methods


GoalDefinition

Represents a snapshot of a goal definition in the system.

Methods


MutationActionDefinition

Represents a snapshot of a mutation action definition.

Methods


RenderActionDefinition

Represents a snapshot of a render action definition.

Methods


Fact

Represents a snapshot of a fact in the system.

Methods


Asset

Represents a snapshot of an asset in the system.

Methods


Incident

Represents a snapshot of an incident in the system.

Methods


Memory

Represents a snapshot of a memory in the system.

Methods


MemorySharingRule

Represents a snapshot of a memory-sharing rule in the system.

Methods


Answer

Represents a snapshot of an answer in the system.

Methods


Episode

Represents a snapshot of an episode in the system.

Methods


Event

Represents a snapshot of an event in the system.

Methods