Update makeprompt.py

This commit is contained in:
Paillat
2023-02-16 10:52:14 +01:00
parent 1943ba4321
commit 5d08c2903b

View File

@@ -142,15 +142,12 @@ To include IMAGES, botator does [image:"here a short title of the image"], then
presence_penalty=float(presence_penalty), presence_penalty=float(presence_penalty),
stop=[" Human:", " AI:", "AI:", "<|endofprompt|>",] stop=[" Human:", " AI:", "AI:", "<|endofprompt|>",]
) )
except Exception as e: except Exception as e:
print(e) print(e)
await asyncio.sleep(15) response = None
if e == "You exceeded your current quota, please check your plan and billing details.": await message.channel.send(f"```diff\n-Error: OpenAI API ERROR.\n\n{e}```")
await message.channel.send("```diff\n-OPENAI ERROR\nYou exceeded your current quota, please check your plan and billing details.```") return
return if response != None: break
else: continue
break
response = response["choices"][0]["text"] response = response["choices"][0]["text"]
Images_capital = re.findall(r"\[Image:(.*?)\]", response) Images_capital = re.findall(r"\[Image:(.*?)\]", response)
#replace all [Image:...] with [image:...] so that we can use the same code for both #replace all [Image:...] with [image:...] so that we can use the same code for both