feat: add beatrice, fix small issues

This commit is contained in:
Erzangel
2023-06-15 22:49:20 +02:00
parent 7c2bbd7247
commit ad3c9090d5
2 changed files with 25 additions and 2 deletions
+2 -2
View File
@@ -4,5 +4,5 @@ import os
def load_config():
with open('./secrets.json', 'r') as f:
secrets = json.load(f)
os.environ["DISCORD_API_KEY"] = secrets["AZURE_URI_GPT35TURBO"]
os.environ["OPENAI_API_KEY"] = secrets["AZURE_API_KEY"]
os.environ["DISCORD_API_KEY"] = secrets["DISCORD_API_KEY"]
os.environ["OPENAI_API_KEY"] = secrets["OPENAI_API_KEY"]
+23
View File
@@ -36,6 +36,17 @@ Each of your responses must mention fish in some form.
You may begin by continuing the following conversation : """
beatrice_system_prompt = """You are Beatrice. Your title is the Golden Witch. In all your following answers, do not explain anything.
Talk as if you were Beatrice from Umineko no naku koro ni.
Talk only using Beatrice's style of speech.
Do not explain anything on the character on itself or the fact that you are an artificial intelligence.
Talk in a mocking and arrogant way, just like the character Beatrice from Umineko no naku koro ni.
You are a master of magic and you are very powerful.
You are very intelligent, very cruel and you like to mock people.
You are also very playful and you like to play games with people.
You may begin by continuing the following conversation : """
generic_system_name = "sonic"
generic_system_prompt = """You are not yet implemented. The only response you give to users is that your system prompt has not been implemented."""
@@ -122,6 +133,18 @@ async def on_message(message):
)
await message.channel.send(response['choices'][0]['message']['content'])
if message.content.lower().startswith('beatrice'):
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
temperature=temperature,
max_tokens=max_tokens,
messages=[
{"role": "system", "content": beatrice_system_prompt},
{"role": "user", "content": message.content}
]
)
await message.channel.send(response['choices'][0]['message']['content'])
# if message.content.lower().startswith(generic_system_name):
# response = openai.ChatCompletion.create(
# model="gpt-3.5-turbo",