Skip to content

Commit

Permalink
fixed bug: claude2.1 reset
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Nov 30, 2023
1 parent 413926e commit 63ea99e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="重置成功!",
Expand Down
2 changes: 1 addition & 1 deletion utils/chatgpt2api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down

0 comments on commit 63ea99e

Please sign in to comment.