prompts¶
The Jinja prompt templates that drive the LLM chains.
Source: src/laife/prompts/.
This package holds template files only, no Python; the chains that use them live in the llm package and the entities package.
Layout¶
Templates are grouped by the chain that uses them, one folder per chain, with one file per version:
player_brain/- the brain, withv1.jinjaandv2.jinja.player_planner/- the planner.player_reply/- the replier.mission_generator/- the mission generator.world_judge_build/,world_judge_craft/,world_judge_complete/- the world judge, one folder per action it validates.
How a template is selected¶
A chain is configured with a PromptLoaderConfig that names the base folder and the chain:
the base folder is prompts_fol from the paths, which resolves to this package, and the prompt name is the chain folder, such as player_brain.
The loader reads the templates from that folder; keeping versions side by side as v1.jinja, v2.jinja lets a prompt evolve without deleting the previous wording.
See the construction sites in entities/player.py and entities/world_runner.py.
Template variables¶
Each template fills the variables the chain provides, for example mission, history, observation, player_state, and inventory for the brain.
Those variable names are not free-form: they are the fields of the chain's input model, and the structured chain derives the required set from those fields, so a template that references an unknown variable is caught.
See the LLM chains guide for that input-model-to-prompt contract.