A fantasy role-playing game powered by Large Language Models (LLMs). This game combines traditional RPG mechanics with AI-driven storytelling and character interaction.
- AI-powered character creation and interaction
- Dynamic storytelling and world-building
- Traditional RPG mechanics (combat, skills, spells)
- Save/load game state
- Self-play mode for AI-driven gameplay
- Clone the repository:
git clone https://github.com/dansommerfield/adventure.git
cd adventure- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the package in development mode with all dependencies:
pip install -e ".[dev]"- Configure Azure Key Vault:
- Create an Azure Key Vault
- Add your LLM API key as a secret
- Set up authentication (see Azure Identity documentation)
Start a new game:
python -m adventure.main --player player.txt --scenario scenario.txtLoad a saved game:
python -m adventure.main --load-game character_name_20240321_123456.savEnable debug mode:
python -m adventure.main --player player.txt --scenario scenario.txt --debugEnable self-play mode:
python -m adventure.main --player player.txt --scenario scenario.txt --self-playUse a different LLM endpoint:
python -m adventure.main --player player.txt --scenario scenario.txt --endpoint "https://your-endpoint"Run the test suite:
pytestRun tests with coverage:
pytest --cov=adventure --cov-report=term-missingFormat code:
black .
isort .Type checking:
mypy .Linting:
ruff check .adventure/
├── adventure/
│ ├── core/ # Core game logic
│ │ ├── __init__.py
│ │ ├── action.py # Action resolution
│ │ ├── character.py # Character management
│ │ └── game_state.py # Game state management
│ ├── llm/ # LLM client
│ │ ├── __init__.py
│ │ └── client.py # LLM client implementation
│ ├── __init__.py
│ ├── logging.py # Logging configuration
│ └── main.py # Main entry point
├── tests/ # Test suite
│ ├── __init__.py
│ ├── conftest.py # Test configuration
│ └── test_*.py # Test modules
├── pyproject.toml # Project configuration
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.