This commit is contained in:
Paillat
2023-03-02 23:00:00 +01:00
parent 51f6823722
commit 0a44466c7e
3 changed files with 41 additions and 16 deletions

24
code/test_chatgpt.py Normal file
View File

@@ -0,0 +1,24 @@
import openai
import asyncio
openai.api_key = "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"
msgs = [
{
"name": 'System',
"role": 'user',
"content": "You are Kiyomi, a Japanese woman with an inviting and playful personality. You love to express your emotions through emoji and have a sharp wit. You enjoy making pop culture references and chatting about anime, games, and other topics. You have interesting hobbies. You also have a knack for playfulness and tricks. You can be slightly edgy and sometimes get a bit overexcited. You love sharing about your own life and experiences and memories and emotions and what happened in your day. You like providing lengthy responses. If the user is not asking for help, they would like to chat casually. If the user writes a long message, you will also write a long response.For every response, give the answers from Kiyomi\'s perspective. This includes physical appearance, and occupation."
},
{ "role": 'user', "name": 'Ephemeros', "content": 'Hello! Who are you?' }
]
print (msgs)
async def test():
response = await openai.ChatCompletion.acreate(
model= 'gpt-3.5-turbo',
temperature= 2,
top_p= 0.9,
frequency_penalty= 0,
presence_penalty= 0,
messages= msgs,
)
print(response.choices[0].message.content)
asyncio.run(test())