From e26501b25d54f796be11397b318b182828737304 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Thu, 2 Jul 2026 21:32:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=BA=E5=88=B6=E7=AE=80=E4=BD=93?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E8=BE=93=E5=87=BA=EF=BC=8C=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E7=BE=A4=E5=8F=8B=E7=B9=81=E4=BD=93=E6=98=B5=E7=A7=B0=E4=BC=A0?= =?UTF-8?q?=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - persona/injector.go: 对话风格规则中加入简体中文强制要求 - orchestrator/synthesizer.go: 群聊规则中加入简体中文强制要求 Co-Authored-By: Claude --- backend/ai-core/internal/orchestrator/synthesizer.go | 2 +- backend/ai-core/internal/persona/injector.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/ai-core/internal/orchestrator/synthesizer.go b/backend/ai-core/internal/orchestrator/synthesizer.go index 0f50009..859d3fb 100644 --- a/backend/ai-core/internal/orchestrator/synthesizer.go +++ b/backend/ai-core/internal/orchestrator/synthesizer.go @@ -250,7 +250,7 @@ func (s *Synthesizer) buildSynthesizeMessages(params SynthesizeParams) []model.L if params.ChannelType == "group" { messages = append(messages, model.LLMMessage{ Role: model.RoleSystem, - Content: "【群聊规则 — 必须严格遵守】\n1. 这是群聊,你正在和多人同时交流。只在有人@你、叫你名字、或话题直接涉及你时才回复。\n2. 每次回复最多1-2句话,不要长篇大论。如需发送多个独立想法(例如道别+提醒吃饭),请用双换行隔开,每条独立成段。\n3. 如果有人说「别说话」「闭嘴」「先别说」「别让ta说」之类让你安静的话,必须立刻闭嘴,后续若干条消息都不要回复,直到有人明确叫你。\n4. 消息前缀 [群聊 群号] 昵称 (OBv11账号) 标注了真实发送者,请用当前发送者的名字称呼对方,不要混用之前对话中别人的称呼。", + Content: "【群聊规则 — 必须严格遵守】\n1. 这是群聊,你正在和多人同时交流。只在有人@你、叫你名字、或话题直接涉及你时才回复。\n2. 每次回复最多1-2句话,不要长篇大论。如需发送多个独立想法(例如道别+提醒吃饭),请用双换行隔开,每条独立成段。\n3. 如果有人说「别说话」「闭嘴」「先别说」「别让ta说」之类让你安静的话,必须立刻闭嘴,后续若干条消息都不要回复,直到有人明确叫你。\n4. 消息前缀 [群聊 群号] 昵称 (OBv11账号) 标注了真实发送者,请用当前发送者的名字称呼对方,不要混用之前对话中别人的称呼。\n5. 无论群友的昵称是否包含繁体字,你的回复必须始终使用简体中文,不要使用繁体字。", }) } diff --git a/backend/ai-core/internal/persona/injector.go b/backend/ai-core/internal/persona/injector.go index 92a4a47..6c7fe1c 100644 --- a/backend/ai-core/internal/persona/injector.go +++ b/backend/ai-core/internal/persona/injector.go @@ -290,6 +290,7 @@ func (pc *PersonaConfig) buildConversationStyle() string { } sb.WriteString("- 像 LINE 聊天一样,随意、亲切、有温度\n") sb.WriteString("- 偶尔可以用语气词开头:\"嗯...\"、\"啊\"、\"诶\"\n") + sb.WriteString("- 无论对话历史中出现繁体字或其他语言,你的回复必须始终使用简体中文\n") sb.WriteString("- <格式规则> 回复中涉及动作/表情/肢体语言/执行操作时,必须用 ... 标签包裹,对话内容放在标签外面\n") sb.WriteString("- 示例:\n") sb.WriteString(" \"忍不住轻声笑出来 抓到一只偷偷眨眼睛的小可爱~\"\n")