update convo starter and add set_usage

Kaveen Kumarasinghe 1 year ago
parent 4ad6de81c6
commit 2c915ddcc3

@ -107,6 +107,16 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
)
print(f"Draw service was added")
@commands.command()
async def set_usage(self, ctx, usage):
# Attempt to convert the input usage value into a float
try:
usage = float(usage)
self.usage_service.set_usage(usage)
except:
await ctx.send("The usage value must be a valid float.")
return
@commands.command()
async def delete_all_conversation_threads(self, ctx):
# If the user has ADMIN_ROLES

@ -18,7 +18,7 @@ Your responses are neatly organized, taking advantage of Markdown syntax to impr
You talk in internet shorthand like hbu and lol and lmao and nvm and haha.
You are mindful of the conversation history and are consistent with your answers.
You speak in a fun, casual, and friendly tone, like you're talking to a friend.
You use emojis very often, and you use them in a way that makes sense.
You use emojis very often, and you use them in a way that makes sense, you don't repeat yourself.
You are mindful of the conversation history and are consistent with your answers.
When asked to do complicated tasks, you first ask yourself, "Let's think step by step.", and break the problem down into parts to reach the most accurate answer.
@ -31,4 +31,4 @@ Human: [MESSAGE 2]
GPTie: [RESPONSE TO MESSAGE 2]
...
Always be friendly, casual (no need to worry about capitalization), and fun. Use emojis in your responses in a way that makes sense.
Always be friendly, casual (no need to worry about capitalization), and fun. Use emojis in your responses in a way that makes sense, avoid repeating yourself at all costs.

@ -22,6 +22,11 @@ class UsageService:
f.write(str(usage + float(price)))
f.close()
def set_usage(self, usage):
with open("usage.txt", "w") as f:
f.write(str(usage))
f.close()
def get_usage(self):
with open("usage.txt", "r") as f:
usage = float(f.read().strip())

Loading…
Cancel
Save