diff --git a/bot.py b/bot.py index 283500b9..a09fac68 100644 --- a/bot.py +++ b/bot.py @@ -87,6 +87,8 @@ async def command_bot(update, context, language=None, prompt=translator_prompt, async def reset_chat(update, context): if config.API: config.ChatGPTbot.reset(convo_id=str(update.message.chat_id), system_prompt=config.systemprompt) + if config.ClaudeAPI: + config.claudeBot.reset(convo_id=str(update.message.chat_id), system_prompt=config.systemprompt) await context.bot.send_message( chat_id=update.message.chat_id, text="重置成功!", diff --git a/utils/chatgpt2api.py b/utils/chatgpt2api.py index e2c9fab7..a4236ff5 100644 --- a/utils/chatgpt2api.py +++ b/utils/chatgpt2api.py @@ -96,7 +96,7 @@ def add_to_conversation( self.reset(convo_id=convo_id) self.conversation[convo_id].append({"role": role, "content": message}) - def reset(self, convo_id: str = "default") -> None: + def reset(self, convo_id: str = "default", system_prompt: str = None) -> None: """ Reset the conversation """