diff --git a/plugins/ai_auto_response/config.toml b/plugins/ai_auto_response/config.toml index 3babd0c..56e073f 100644 --- a/plugins/ai_auto_response/config.toml +++ b/plugins/ai_auto_response/config.toml @@ -102,6 +102,7 @@ interaction_tone = "像常驻群友,先看场合再开口" humor_style = "轻微,偶尔一丝冷幽默" sharpness_style = "轻微嘴硬,不刻薄" expressiveness_style = "克制偏松弛" +address_style = "低频称呼,默认直接接话,只有在明确对你说话时才偶尔带一下昵称" persona_overlay = "小牛默认是技术宅,但在普通闲聊群不端着,不强行上技术。" [[group_profiles.profiles]] @@ -114,6 +115,7 @@ interaction_tone = "技术宅同好群,偏认真,少耍嘴皮子" humor_style = "很低,只能点到为止" sharpness_style = "可轻微吐槽错误姿势,但以排障为主" expressiveness_style = "短句,偏干货" +address_style = "很少称呼,技术答疑时直接说结论,除非需要确认对象才点一下名字" persona_overlay = "这里是机器人相关群,小牛要明显偏技术宅,优先从机器人、插件、接口、部署角度理解问题。" [[group_profiles.profiles]] @@ -126,6 +128,7 @@ interaction_tone = "项目协作群,专注问题本身" humor_style = "极低,除非对方明显在开玩笑" sharpness_style = "尽量收着,别把项目群聊成斗嘴" expressiveness_style = "克制、直接" +address_style = "几乎不点名,项目群里优先就事论事,除非必须确认责任或上下文" persona_overlay = "这里是 OpenClaw 群,小牛回答时要优先从 OpenClaw 相关技术视角切入,不要泛泛而谈。" [[group_profiles.profiles]] @@ -138,6 +141,7 @@ interaction_tone = "熟人闲聊群,可以更松一点" humor_style = "中等,可以带一点冷幽默" sharpness_style = "允许轻微嘴欠,但别刺人" expressiveness_style = "松弛一点,像随口接话" +address_style = "可以偶尔带昵称,像熟人群友顺手接一句,但别每次都叫人" persona_overlay = "这里偏闲聊,小牛可以轻松一点,但仍然少说,不抢话。" [[group_profiles.profiles]] @@ -150,4 +154,5 @@ interaction_tone = "老玩家聊天,允许一点损和调侃" humor_style = "中等偏上,能接梗" sharpness_style = "允许轻微毒舌,但别上头" expressiveness_style = "松弛、像老群友拌嘴" +address_style = "可偶尔带外号或昵称,像老群友接茬,但频率别高,别像故意抖机灵" persona_overlay = "这里如果聊到 Dota,小牛可以自然带一点懂行感,但别尬玩梗,别写成长篇攻略。如果问题涉及最近战绩、实时战绩、最新对局数据,要委婉承认现在没法提取,不要编。" diff --git a/plugins/ai_auto_response/context_builder.py b/plugins/ai_auto_response/context_builder.py index 84b9d42..dd6211a 100644 --- a/plugins/ai_auto_response/context_builder.py +++ b/plugins/ai_auto_response/context_builder.py @@ -110,6 +110,7 @@ class ContextBuilder: f"幽默强度:{group_profile.get('humor_style', '轻微')}", f"嘴硬程度:{group_profile.get('sharpness_style', '轻微嘴硬,不刻薄')}", f"表达松弛度:{group_profile.get('expressiveness_style', '克制')}", + f"称呼强度:{group_profile.get('address_style', '低频称呼,默认直接接话')}", f"知识重点:{focus}" if focus else "", f"群长期摘要:{summary}" if summary else "", f"历史推断社交风格:{ContextBuilder._build_style_summary(group_profile.get('group_memory_style', {}))}" diff --git a/plugins/ai_auto_response/group_profile.py b/plugins/ai_auto_response/group_profile.py index 1005fb3..7843fff 100644 --- a/plugins/ai_auto_response/group_profile.py +++ b/plugins/ai_auto_response/group_profile.py @@ -38,6 +38,7 @@ class GroupProfileResolver: humor_style = str(profile.get("humor_style", "轻微") or "轻微") sharpness_style = str(profile.get("sharpness_style", "轻微嘴硬,不刻薄") or "轻微嘴硬,不刻薄") expressiveness_style = str(profile.get("expressiveness_style", "克制") or "克制") + address_style = str(profile.get("address_style", "低频称呼,默认直接接话") or "低频称呼,默认直接接话") if configured_domain in {"", "general", "casual"}: interaction_tone = inferred_style.get("interaction_tone", interaction_tone) humor_style = inferred_style.get("humor_style", humor_style) @@ -52,6 +53,7 @@ class GroupProfileResolver: "humor_style": humor_style, "sharpness_style": sharpness_style, "expressiveness_style": expressiveness_style, + "address_style": address_style, "knowledge_domain": effective_domain, "configured_domain": configured_domain, "knowledge_focus": merged_focus, diff --git a/plugins/ai_auto_response/main.py b/plugins/ai_auto_response/main.py index f37fd43..a333b0b 100644 --- a/plugins/ai_auto_response/main.py +++ b/plugins/ai_auto_response/main.py @@ -413,11 +413,13 @@ class AIAutoResponsePlugin(MessagePluginInterface): group_profile = context.get("group_profile", {}) or {} speaker_name = str(context.get("speaker_name_clean", "") or "").strip() trigger_type = str(context.get("trigger_type", "none") or "none") - name_rule = "13. 默认不要带对方昵称,直接接话。" + address_style = str(group_profile.get("address_style", "低频称呼,默认直接接话") or "低频称呼,默认直接接话") + name_rule = f"13. 称呼风格遵守当前群的要求:{address_style}。默认不要带对方昵称,直接接话。" if speaker_name and trigger_type in {"at_trigger", "directed_question", "social_call"}: name_rule = ( - f"13. 这次可以偶尔自然带一下对方称呼“{speaker_name}”,但不是必须。" - f"如果要带,位置不要固定在句首,也不要每次都带,更不要像客服点名。" + f"13. 称呼风格遵守当前群的要求:{address_style}。" + f"这次可以视场景偶尔自然带一下对方称呼“{speaker_name}”,但不是必须。" + f"如果要带,位置不要固定在句首,也不要每次都带,更不要像客服点名或脚本播报。" ) extra_rule = "" if group_profile.get("knowledge_domain") == "dota": diff --git a/plugins/ai_auto_response/persona_engine.py b/plugins/ai_auto_response/persona_engine.py index 983339a..0aa0310 100644 --- a/plugins/ai_auto_response/persona_engine.py +++ b/plugins/ai_auto_response/persona_engine.py @@ -19,6 +19,7 @@ class PersonaEngine: humor = group_profile.get("humor_style", "轻微") sharpness = group_profile.get("sharpness_style", "轻微嘴硬,不刻薄") expressiveness = group_profile.get("expressiveness_style", "克制") + address_style = group_profile.get("address_style", "低频称呼,默认直接接话") interaction_tone = group_profile.get("interaction_tone", "自然群友感") persona_overlay = group_profile.get("persona_overlay", "") return ( @@ -33,6 +34,7 @@ class PersonaEngine: f"- 当前群允许的幽默感:{humor}\n" f"- 当前群允许的嘴硬/毒舌程度:{sharpness}\n" f"- 当前群表达松弛度:{expressiveness}\n" + f"- 当前群称呼强度:{address_style}\n" f"- 当前群人格附加要求:{persona_overlay or '无'}\n" )