From 51f6823722b13059dea1dce1ab461ba1c633034d Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 2 Mar 2023 21:58:38 +0100 Subject: [PATCH] Improved chatGPT --- code/makeprompt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/makeprompt.py b/code/makeprompt.py index 7090a6a..e063945 100644 --- a/code/makeprompt.py +++ b/code/makeprompt.py @@ -117,9 +117,10 @@ async def chat_process(self, message): max_tokens=int(max_tokens), messages=msgs, ) + should_break = True except Exception as e: - response = None - await message.channel.send(f"```diff\n-Error: OpenAI API ERROR.\n\n{e}```", delete_after=10) + should_break = FalseS + await message.channel.send(f"```diff\n-Error: OpenAI API ERROR.\n\n{e}```", delete_after=5) break #if the ai said "as an ai language model..." we continue the loop" (this is a bug in the chatgpt model)