llm¶
The LLM reasoning a player uses, and the mission model it reasons about.
Source: src/laife/llm/.
For the shared chain pattern and how the chains fit a turn see the LLM chains guide.
Chains¶
player_brain.py- the brain. Owns the player's four chains: the action picker, which turns an observation and the current mission into the next action, and the three below.player_planner.py- the planner's input and output. The planner decomposes a mission into ordered sub-missions.player_replier.py- the replier's input and output. The replier writes an in-character reply to a message from another player.mission_generator.py- the mission generator's input and output. The generator proposes a fresh mission objective from the current world observation.
Each chain pairs a BaseModelKwargs input, whose fields define the required prompt variables, with a prompt template and a validated pydantic output; the brain builds the chains from them.
Mission model¶
mission.py defines the mission and its history.
A mission carries an objective, a status, and a list of action and result entries, and missions can nest.
The history renders to prompt text, so the brain and planner always see what has been tried.
The world judge that validates build and craft actions is the world's reasoning rather than the player's; it lives in the entities package.