mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
Update code.py
This commit is contained in:
10
code/code.py
10
code/code.py
@@ -267,14 +267,14 @@ async def pretend(ctx, pretend_to_be: str, message: str):
|
|||||||
#set the openai api key
|
#set the openai api key
|
||||||
openai.api_key = data[2]
|
openai.api_key = data[2]
|
||||||
prompt = f"Pretend to be {pretend_to_be} and answer the following question: {message}: \n"
|
prompt = f"Pretend to be {pretend_to_be} and answer the following question: {message}: \n"
|
||||||
|
debug(f"The prompt is: {prompt}")
|
||||||
response = openai.Completion.create(
|
response = openai.Completion.create(
|
||||||
engine="text-davinci-003",
|
engine="text-davinci-003",
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
temperature=data[5],
|
temperature=1,
|
||||||
max_tokens=data[4],
|
max_tokens=64,
|
||||||
frequency_penalty=data[6],
|
frequency_penalty=0.0,
|
||||||
presence_penalty=data[7],
|
presence_penalty=0.0,
|
||||||
stop=[""],
|
|
||||||
)
|
)
|
||||||
#send the message
|
#send the message
|
||||||
await ctx.respond(response["choices"][0]["text"])
|
await ctx.respond(response["choices"][0]["text"])
|
||||||
|
|||||||
Reference in New Issue
Block a user