diff --git a/src/clover_sqlite/models/chat.py b/src/clover_sqlite/models/chat.py index 0928bf1..d929722 100644 --- a/src/clover_sqlite/models/chat.py +++ b/src/clover_sqlite/models/chat.py @@ -210,6 +210,7 @@ class GroupChatRole(Model): role_setting = await ChatRole.get_role_setting(role_name=role_name) if role_setting: existing_record.role_name = role_name + role_setting = role_setting + "\n你现在在qq群聊聊天,回复一定要口语化(这非常重要),不要使用markdown。如果在讲解概念、题目,请详细回复(50字以上);如果是闲聊,回复严禁超出35个字。" data = [{"role": "system", "content": role_setting}] existing_record.role_chat_history = data await existing_record.save() @@ -235,11 +236,11 @@ class GroupChatRole(Model): await history.save() else: history.role_chat_history.append(content) - if len(history.role_chat_history) > 5: - history.role_chat_history.pop(2) + if len(history.role_chat_history) > 12: + history.role_chat_history.pop(1) - data = {"role": "system", "content": "你现在在qq群聊聊天,回复一定要口语化(这非常重要),不要使用markdown。如果在讲解概念、题目,请详细回复(50字以上);如果是闲聊,回复严禁超出35个字。"} - history.role_chat_history.append(data) + #data = {"role": "system", "content": "你现在在qq群聊聊天,回复一定要口语化(这非常重要),不要使用markdown。如果在讲解概念、题目,请详细回复(50字以上);如果是闲聊,回复严禁超出35个字。"} + #history.role_chat_history.append(data) print(history.role_chat_history) await history.save()