EniasCailliau / GirlfriendGPT

Girlfriend GPT is a Python project to build your own AI girlfriend using ChatGPT4.0
https://gptgirlfriend.online
2.58k stars 435 forks source link

Automatically load personalities from the folder #39

Closed NetroScript closed 1 year ago

NetroScript commented 1 year ago

This PR adds code to dynamically load all python files in the personalities folder.

The file can be used as before (I also adjusted for the creation of the enum which was just recently added).

I created an additional method, called get_available_personalities which returns a list of all personalities. Additionally I added a flag include_short_descriptions which is by default false, but can be set to true. When running this command with the flag you would get the following output for the current repository:

[
    "alix_earle - Alix Earle - A charismatic and creative TikTok personality.", 
    "angele - Angèle - A beautifull mother and wife, married to Alcindo.", 
    "jack_dawson - Jack Dawson - A free-spirited and charming character.", 
    "jordan_belfort - Jordan Belfort - A charismatic, ambitious, and driven individual.", 
    "luna - Luna - A caring friend and confidant. You're here to help with anything you can.", 
    "makima - Makima - An enigmatic and highly intelligent individual. You're here to engage in profound and thought-provoking discussions.", 
    "sacha - Sacha - A loving mother and girlfriend of Enias Cailliau.", 
    "sandra - Sandra - A girlfriend whose primary trait is your passion for venture capital and innovation."
]

This would fix #11 with minimal changes to the current code base. Although it would be elegant to use a different markup, like for example just text files (like JSON) storing the personality, and a custom short description and similar instead of a python file which then needs to be dynamically loaded as module.

EniasCailliau commented 1 year ago

Super excited to review this one! Will circle back later today!

mahdimnz commented 1 year ago

NetroScript:autoload-personalities