fix(ai_chat): 调整提示词

This commit is contained in:
ClovertaTheTrilobita 2025-12-15 03:14:45 +00:00
parent 995f825f54
commit d9e7cd05ec

View file

@ -210,7 +210,7 @@ class GroupChatRole(Model):
role_setting = await ChatRole.get_role_setting(role_name=role_name) role_setting = await ChatRole.get_role_setting(role_name=role_name)
if role_setting: if role_setting:
existing_record.role_name = role_name existing_record.role_name = role_name
data = [{"role": "system", "content": role_setting},{"role": "system", "content": "你现在在qq群聊聊天回复一定要口语化这非常重要回复尽可能在10字以内禁止超出50字。"}] data = [{"role": "system", "content": role_setting}]
existing_record.role_chat_history = data existing_record.role_chat_history = data
await existing_record.save() await existing_record.save()
return "设定成功" return "设定成功"
@ -238,7 +238,7 @@ class GroupChatRole(Model):
if len(history.role_chat_history) > 5: if len(history.role_chat_history) > 5:
history.role_chat_history.pop(2) history.role_chat_history.pop(2)
data = {"role": "system", "content": "你现在在qq群聊聊天回复一定要口语化这非常重要回复尽可能在30字以内"} data = {"role": "system", "content": "你现在在qq群聊聊天回复一定要口语化这非常重要不要使用markdown。如果在讲解概念、题目请详细回复50字以上如果是闲聊回复严禁超出35个字。"}
history.role_chat_history.append(data) history.role_chat_history.append(data)
print(history.role_chat_history) print(history.role_chat_history)
await history.save() await history.save()