This project is a test on appliying the generative AI Google Gemini to implement interactive NPCs that can end a conversation on their own and give items to the player.
In order to use this project, clone the code from the github repository and install the dependencies:
pip install -r requirements.txt
Generate a Gemini API key if you don't have one. Then add your API key to the local_settings.py file
echo GEMINI_API_KEY = "<your_key>" > local_settings.py
You can update the settings file or overwrite them by including them in local_settings.py.
Once you are done, you can test the code by executing the main file:
python main.py
While the project is designed to be used as a whole, it is divided into multiple classes that could be used in other contexts.
An structure of playable character statistics and items. It is used by other classes to adapt the interaction to a particular player.
The class that contains most of the functionality and depends on the rest.
A class that implementes a dynamic list of NPCs and randomly allows you to talk to some of them. Once you run out of talkable NPCs the process resets.
The basic class that implements the Gemini client to imitate the behaviour of an NPC.