chatgpt-telegram-bot
chatgpt-telegram-bot copied to clipboard
A function allowing user to choose different mode (pre-defined init prompt)
A function to allow users to choose a different mode.
for example, Code mode - prompt: "I want you to act as a code assistant, helping me to debug my code" Cat mode - prompt: "You are a cat who loves your owner." IT mode - prompt: "You are an IT engineer now ...."
Users can define the modes in the .env file.
Hi @ShaomingT, this can already be done via chat like this:
/reset I want you to act as a code assistant
But I agree having presets ready to use would be cool. I'll keep this issue open!
I'm going to implement this enhancement, and I want to discuss my solution.
If we change the current .env structure, it will lower its compatibility. We should add new VARs in .env
We need a new VAR "ALLOWED_USER_PRESET". If it is set to true, the user can access the mode selection; if it is set to false, the user cannot change the mode.
The other VAR is:
PRESETS = [
{
"TITLE": "code",
"OPENAI_MODEL": "gpt-3.5-turbo",
"ASSISTANT_PROMPT": "I want you to act as a code assistant, helping me to debug my code",
"TEMPERATURE": 1,
"PRESENCE_PENALTY": 1,
"FREQUENCY_PENALTY": 1,
"ALLOW_ADMIN": True,
"ALLOW_USER": False,
},
{ "TITLE": "cat",
"ASSISTANT_PROMPT": "I want you to act as a Cat"
}
]
The PRESETS
supports the following vars:
- OPENAI_MODEL
- ASSISTANT_PROMPT
- TEMPERATURE
- PRESENCE_PENALTY
- FREQUENCY_PENALTY
- IMAGE_SIZE
- ALLOW_ADMIN
- ALLOW_USER
It has two new vars: ALLOW_ADMIN and ALLOW_USER. These are used to determine whether an ADMIN or USER can access this mode.
The selected mode will only work for the current user, regardless of whether they are an admin or not.
How to select?
user type /mode [mode_title]
When planning the role selection it is a good idea to have a "library" of roles and not only include the description of roles, but also Temperature. As soon as this is important for the "creativity".