EniasCailliau / GirlfriendGPT

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

How to change between different personalities? #9

Closed som-sama closed 1 year ago

som-sama commented 1 year ago

There are three personalities currently: agnele, luna, sacha. How do I switch between them?

For example: my agent is sacha and I want to talk with luna. How can I do that?

image
som-sama commented 1 year ago

Its my bad that I overlooked __init__.py into the src/personality directory where the function get_personality explains us how to shift between the bots.

This is how the code looks like:

def get_personality(name: str):
    try:
        return {
            "luna": luna,
            "sacha": sacha,
            "Angèle": angele,
            "Makima": makima
        }[name]
    except Exception:
        raise Exception("The personality you selected does not exist!")

For those who might be still confused, we just do name: <bot-name> into the prompt and it will shift to the bot.

image