haive.games.mafia.mock_runner¶
Mock runner for the Mafia game.
This module provides a simplified version of the Mafia game runner that uses mock responses instead of actual LLMs, allowing for faster testing and demonstration without requiring API keys or internet access.
Examples
`bash
python mock_runner.py --players 5 --days 1 --debug
`
Classes¶
A mock engine that returns predefined responses. |
Functions¶
|
Generate a mock response for a detective player. |
|
Generate a mock response for a doctor player. |
|
Generate a mock response for a mafia player. |
|
Generate a mock response for the narrator. |
|
Generate a mock response for a villager player. |
|
Main entry point for command-line execution. |
|
Run a mock Mafia game simulation with synthetic responses. |
Module Contents¶
- class haive.games.mafia.mock_runner.MockEngine(role)¶
A mock engine that returns predefined responses.
Init .
- Parameters:
role – [TODO: Add description]
- invoke(context)¶
Generate a mock response based on the role.
- haive.games.mafia.mock_runner.generate_detective_response(context)¶
Generate a mock response for a detective player.
- Parameters:
- Return type:
- haive.games.mafia.mock_runner.generate_doctor_response(context)¶
Generate a mock response for a doctor player.
- Parameters:
- Return type:
- haive.games.mafia.mock_runner.generate_mafia_response(context)¶
Generate a mock response for a mafia player.
- Parameters:
- Return type:
- haive.games.mafia.mock_runner.generate_narrator_response(context)¶
Generate a mock response for the narrator.
- Parameters:
- Return type:
- haive.games.mafia.mock_runner.generate_villager_response(context)¶
Generate a mock response for a villager player.
- Parameters:
- Return type:
- haive.games.mafia.mock_runner.main()¶
Main entry point for command-line execution.
- haive.games.mafia.mock_runner.run_mafia_game_mock(player_count=5, max_days=1, debug=True)¶
Run a mock Mafia game simulation with synthetic responses.
- This function sets up and executes a full Mafia game, handling:
Player creation and role assignment
Game state initialization
Turn-based gameplay execution using mock responses
State visualization
Game end conditions
- Parameters:
- Raises:
ValueError – If player_count is less than 4.
- Return type:
None