Extended functionality requires an understanding of the modular design of the project:
- Instruction to add: in
main.py
Define the response logic for new commands in the synchronized update of the prompt template of gpt-ossgpt-oss-template.jinja
, ensuring that the model understands the new instructions. - scene construction: By editing the game state machine (e.g.
game_state.py
) Add new scene classes and associate corresponding voice trigger conditions and AI response text. - test and verify: Whisper's speech recognition accuracy needs to be tested after adding new content, and training data added to fine-tune it if necessary.
It is recommended to refer to the module interface descriptions in the project documentation to keep the code style consistent.
This answer comes from the articlegpt-oss-space-game: a local voice-interactive space game built using open-source AI modelsThe