diff --git a/config.py b/config.py index 02b52c5..26cda84 100644 --- a/config.py +++ b/config.py @@ -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"] diff --git a/hanyuu.py b/hanyuu.py index e1c3a46..1813ae3 100644 --- a/hanyuu.py +++ b/hanyuu.py @@ -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",