mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-23 23:55:05 +01:00
allow content passed by system role to be customized on reset
This commit is contained in:
@@ -124,11 +124,13 @@ class OpenAIHelper:
|
||||
result = await openai.Audio.atranscribe("whisper-1", audio)
|
||||
return result.text
|
||||
|
||||
def reset_chat_history(self, chat_id):
|
||||
def reset_chat_history(self, chat_id, content):
|
||||
"""
|
||||
Resets the conversation history.
|
||||
"""
|
||||
self.conversations[chat_id] = [{"role": "system", "content": self.config['assistant_prompt']}]
|
||||
if content == '':
|
||||
content = self.config['assistant_prompt']
|
||||
self.conversations[chat_id] = [{"role": "system", "content": content}]
|
||||
|
||||
def __max_age_reached(self, chat_id) -> bool:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user