|
|
@ -62,9 +62,6 @@ class ImgPromptOptimizer(commands.Cog, name="ImgPromptOptimizer"):
|
|
|
|
for arg in args:
|
|
|
|
for arg in args:
|
|
|
|
prompt += arg + " "
|
|
|
|
prompt += arg + " "
|
|
|
|
|
|
|
|
|
|
|
|
print(
|
|
|
|
|
|
|
|
f"Received an image optimization request for the following prompt: {prompt}"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
# Get the token amount for the prompt
|
|
|
|
# Get the token amount for the prompt
|
|
|
|
tokens = self.usage_service.count_tokens(prompt)
|
|
|
|
tokens = self.usage_service.count_tokens(prompt)
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +81,7 @@ class ImgPromptOptimizer(commands.Cog, name="ImgPromptOptimizer"):
|
|
|
|
|
|
|
|
|
|
|
|
response_text = response["choices"][0]["text"]
|
|
|
|
response_text = response["choices"][0]["text"]
|
|
|
|
|
|
|
|
|
|
|
|
print(f"Received the following response: {response.__dict__}")
|
|
|
|
#print(f"Received the following response: {response.__dict__}")
|
|
|
|
|
|
|
|
|
|
|
|
if re.search(r"<@!?\d+>|<@&\d+>|<#\d+>", response_text):
|
|
|
|
if re.search(r"<@!?\d+>|<@&\d+>|<#\d+>", response_text):
|
|
|
|
await ctx.reply("I'm sorry, I can't mention users, roles, or channels.")
|
|
|
|
await ctx.reply("I'm sorry, I can't mention users, roles, or channels.")
|
|
|
|