mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06: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:
@@ -6,7 +6,7 @@ import datetime
|
||||
import json
|
||||
|
||||
from src.config import curs_data, max_uses, curs_premium, gpt_3_5_turbo_prompt
|
||||
from src.utils.misc import moderate
|
||||
from src.utils.misc import moderate, ModerationError
|
||||
from src.utils.openaicaller import openai_caller
|
||||
from src.functionscalls import (
|
||||
call_function,
|
||||
@@ -159,6 +159,7 @@ async def chatgpt_process(
|
||||
await message.channel.send(
|
||||
"Oh uh, it seems like i am answering recursively. I will stop now."
|
||||
)
|
||||
raise ModerationError("Too many recursive messages")
|
||||
await chatgpt_process(
|
||||
self, msgs, message, api_key, prompt, model, error_call, depth
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user