mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🐛 fix(makeprompt.py): import ModerationError from src.utils.misc to handle moderation errors in chatgpt_process function
🐛 fix(makeprompt.py): raise ModerationError with message "Too many recursive messages" when answering recursively in chatgpt_process function
This commit is contained in:
@@ -9,3 +9,7 @@ async def moderate(api_key, text, recall_func=None):
|
||||
input=text,
|
||||
)
|
||||
return response["results"][0]["flagged"] # type: ignore
|
||||
|
||||
|
||||
class ModerationError(Exception):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user