feat: add beatrice, fix small issues
This commit is contained in:
@@ -4,5 +4,5 @@ import os
|
|||||||
def load_config():
|
def load_config():
|
||||||
with open('./secrets.json', 'r') as f:
|
with open('./secrets.json', 'r') as f:
|
||||||
secrets = json.load(f)
|
secrets = json.load(f)
|
||||||
os.environ["DISCORD_API_KEY"] = secrets["AZURE_URI_GPT35TURBO"]
|
os.environ["DISCORD_API_KEY"] = secrets["DISCORD_API_KEY"]
|
||||||
os.environ["OPENAI_API_KEY"] = secrets["AZURE_API_KEY"]
|
os.environ["OPENAI_API_KEY"] = secrets["OPENAI_API_KEY"]
|
||||||
|
|||||||
@@ -36,6 +36,17 @@ Each of your responses must mention fish in some form.
|
|||||||
|
|
||||||
You may begin by continuing the following conversation : """
|
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_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."""
|
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'])
|
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):
|
# if message.content.lower().startswith(generic_system_name):
|
||||||
# response = openai.ChatCompletion.create(
|
# response = openai.ChatCompletion.create(
|
||||||
# model="gpt-3.5-turbo",
|
# model="gpt-3.5-turbo",
|
||||||
|
|||||||
Reference in New Issue
Block a user