Skip to content

Juanma-Sanchez/NPC_Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPC Test

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.

Installation

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 

Usage

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

Classes

While the project is designed to be used as a whole, it is divided into multiple classes that could be used in other contexts.

Player

An structure of playable character statistics and items. It is used by other classes to adapt the interaction to a particular player.

Narrator

The class that contains most of the functionality and depends on the rest.

NPCList

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.

NPC

The basic class that implements the Gemini client to imitate the behaviour of an NPC.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages