API reference¶
The common names can be imported straight from tyrant: GameRunner, Agent, GameState, Action, the enums, the engine functions, the bundled agents and the exceptions.
from tyrant import GameRunner, Party, RandomAgent
Each subpackage exports its full vocabulary:
| Package | Exports |
|---|---|
tyrant.models |
Every model, action, event, claim, knowledge and enum type, plus create_game and scrub_state |
tyrant.engine |
GameRunner, get_legal_actions, apply_action, the renderer and the replay functions |
tyrant.agents |
RandomAgent and BiasedRandomAgent |
tyrant.llm |
SYSTEM_PROMPT, build_prompt, parse_action, parse_notes and MAX_NOTES_LENGTH |
tyrant.llm.agent |
LLMAgent, which needs the llm extra |
tyrant.exceptions |
TyrantError and InvalidMoveError |
Anything not listed in a package's __all__ is internal and may change.