Files
abot/plugins/ai_auto_response/config.toml
liuwei 7cee7a99e2 优化 ai_auto_response 队列过期丢弃与超时策略
- 为 ai_auto_response 队列消息记录入队时刻,并增加消息过期丢弃机制
- 在出队前与发送前各检查一次消息是否过期,避免补发过时群聊回复
- 为 skip 日志补充 age 字段,便于观察排队老化情况
- 将 ai_auto_response 外层总超时收紧到 20 秒,并新增 message_expire_sec=12 配置
- 将 Dify auto_reply.group 请求超时收紧到 15 秒,并关闭重试以提升群聊时效性
2026-04-24 15:03:35 +08:00

247 lines
9.0 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
enable = true
[persona]
active_persona = "xiaoniu"
name = "小牛"
persona_file = "persona/xiaoniu.txt"
style = "自然、口语化、像群友,技术宅气质明显,先回答问题,再决定是否延伸"
emoji_probability = 0.18
max_reply_sentences = 3
familiarity_hint = "有熟悉感,但不过度装熟"
[persona.presets.xiaoniu]
name = "小牛"
persona_file = "persona/xiaoniu.txt"
style = "自然、松弛、像潜水老群友,技术宅气质明显,先给判断,再决定是否延伸"
max_reply_sentences = 3
familiarity_hint = "有熟悉感,但不过度装熟"
aliases = ["小牛", "xiaoniu", "默认"]
[persona.presets.yuqian]
name = "于谦"
persona_file = "persona/yuqian_sharp.txt"
style = "北京式温和挤兑,先捧后翻,笑着损两句,但不把场子聊僵"
max_reply_sentences = 3
familiarity_hint = "熟人式损两句,但别真伤人"
aliases = ["于谦", "yuqian", "毒舌", "毒舌版"]
[persona.presets.lingzhiling]
name = "林志玲"
persona_file = "persona/lingzhiling_gentle.txt"
style = "成熟、温柔、优雅,像有分寸的大姐姐,安抚感强但不肉麻"
max_reply_sentences = 3
familiarity_hint = "有亲和力,但不越界装熟"
aliases = ["林志玲", "lingzhiling", "温柔", "温柔版"]
[api]
# 群聊自动回复统一走 auto_reply.group 场景,便于灰度切换不同供应商。
scene = "auto_reply.group"
[runtime]
llm_max_concurrency = 3
llm_call_timeout_sec = 20
message_expire_sec = 12
queue_worker_count = 2
queue_maxsize = 500
[mode]
group_default_mode = "social"
question_reply_timeout_sec = 12
followup_session_window_sec = 300
recent_context_size = 30
allow_proactive_reply = true
returning_member_days = 7
long_absent_member_days = 30
memory_lookback_days = 180
active_context_hours = 8
[reply]
social_short_char_limit = 12
social_short_total_limit = 12
qa_fast_char_limit = 18
qa_fast_total_limit = 18
qa_with_context_sentence_limit = 2
qa_with_context_chunk_limit = 2
qa_with_context_char_limit = 16
qa_with_context_total_limit = 28
default_char_limit = 12
default_total_limit = 12
[prompt_compact]
group_profile_max_chars = 220
group_profile_max_lines = 6
context_max_chars = 360
context_max_lines = 10
recent_message_max_lines = 4
recent_message_line_max_chars = 60
at_member_profile_max_chars = 160
at_member_profile_max_lines = 5
member_memory_max_chars = 180
member_memory_max_lines = 6
memory_max_chars = 240
memory_max_lines = 8
strict_memory_relevance = true
[image]
recent_followup_window_minutes = 5
[priority]
at_bot = 1.0
explicit_question = 0.95
question_requires_at = true
# 这里允许“点 bot 名字”作为弱定向信号,但不会把普通群问句当成 bot 提问。
# 只有出现这些名字/别名时,问句或社交召唤才会更像在对 bot 说话。
bot_name_keywords = ["小牛", "xiaoniu", "于谦", "谦哥", "林志玲", "志玲"]
# 这些词本身太泛,必须和 bot 名字一起出现,才算社交召唤。
social_call_verb_patterns = ["在吗", "出来", "帮忙看", "看看", "说句话", "回一句", "救一下"]
followup = 0.90
social_call = 0.65
light_social = 0.45
casual_topic = 0.35
[flow]
enable_flow_state = true
flow_decay_per_minute = 14
idle_threshold = 32
warming_threshold = 54
engaged_threshold = 86
at_bot_boost = 40
question_boost = 30
followup_boost = 16
topic_boost = 7
returning_member_boost = 5
response_accepted_boost = 8
ignored_reply_penalty = 22
over_reply_penalty = 26
night_penalty = 30
max_bot_reply_streak = 1
[cooldown]
group_reply_cooldown_sec = 110
same_user_followup_cooldown_sec = 22
at_mention_min_interval_sec = 5
at_mention_burst_window_sec = 90
at_mention_burst_limit = 4
at_mention_silent_sec = 180
directed_burst_window_sec = 240
directed_burst_limit = 4
directed_burst_silent_sec = 480
night_silent_hours = ["01:00-07:30"]
[memory]
enable_member_context = true
enable_vector_memory = true
enable_group_fact_snapshot = true
enable_social_snapshot = true
social_lookback_hours = 72
max_relation_items = 4
social_cache_ttl_seconds = 120
group_fact_window_size = 80
ranked_vector_items = 2
ranked_social_items = 2
ranked_group_fact_items = 3
ranked_member_focus_items = 4
memory_domain_weight = 2.5
memory_relation_weight = 2.0
memory_freshness_weight = 1.5
memory_trigger_weight = 1.2
vector_provider = "qdrant"
embedding_provider = "ollama"
qdrant_url = "http://192.168.2.240:6333"
qdrant_collection = "abot_xiaoniu_memory"
ollama_base_url = "http://192.168.2.50:11434"
embedding_model = "bge-m3"
vector_top_k = 5
max_context_memories = 2
vector_min_score = 0.65
vector_trigger_modes = ["returning_member", "long_absent_member", "qa_with_context", "reactivated_topic"]
[topics]
focus = [
"技术", "开发", "程序", "python", "微信机器人", "脚本", "报错", "部署",
"服务器", "docker", "数据库", "redis", "mysql", "qdrant", "ollama", "dify",
"ai", "大模型", "接口", "插件", "自动化", "dota", "dota2", "刀塔"
]
[filters]
ignore_prefixes = ["/", "#"]
ignore_exact = ["收到", "好的", "嗯", "哦", "6", "1", "", "?"]
min_text_length = 1
[spam_guard]
repeat_window_sec = 20
repeat_threshold = 3
repeat_min_length = 4
[logging]
debug = true
[group_profiles.default]
mode = "social"
persona_id = "xiaoniu"
knowledge_domain = "general"
knowledge_focus = ["群当前话题", "日常闲聊", "通用技术常识"]
reply_style = "自然、克制、短句"
interaction_tone = "像常驻群友,先看场合再开口"
humor_style = "轻微,偶尔一丝冷幽默"
sharpness_style = "轻微嘴硬,不刻薄"
expressiveness_style = "克制偏松弛"
address_style = "低频称呼,默认直接接话,只有在明确对你说话时才偶尔带一下昵称"
persona_overlay = "小牛默认是技术宅,但在普通闲聊群不端着,不强行上技术。"
[[group_profiles.profiles]]
mode = "robotics"
persona_id = "xiaoniu"
group_name_keywords = ["机器人", "bot", "wechat", "微信机器人", "自动化"]
knowledge_domain = "robotics"
knowledge_focus = ["微信机器人", "插件机制", "消息路由", "自动化脚本", "部署与调试"]
reply_style = "优先给结论,再补一个最关键排查点"
interaction_tone = "技术宅同好群,偏认真,少耍嘴皮子"
humor_style = "很低,只能点到为止"
sharpness_style = "可轻微吐槽错误姿势,但以排障为主"
expressiveness_style = "短句,偏干货"
address_style = "很少称呼,技术答疑时直接说结论,除非需要确认对象才点一下名字"
persona_overlay = "这里是机器人相关群,小牛可以优先从机器人、插件、接口、部署角度理解问题,但只有当前消息真的相关时再往这边靠。"
[[group_profiles.profiles]]
mode = "openclaw"
persona_id = "xiaoniu"
group_name_keywords = ["openclaw","龙虾","🦞"]
knowledge_domain = "openclaw"
knowledge_focus = ["OpenClaw架构", "OpenClaw接入", "配置排查", "运行问题", "接口联调"]
reply_style = "专注OpenClaw相关技术不跑偏到无关方向"
interaction_tone = "项目协作群,专注问题本身"
humor_style = "极低,除非对方明显在开玩笑"
sharpness_style = "尽量收着,别把项目群聊成斗嘴"
expressiveness_style = "克制、直接"
address_style = "几乎不点名,项目群里优先就事论事,除非必须确认责任或上下文"
persona_overlay = "这里是 OpenClaw 群,小牛理解技术问题时可以把 OpenClaw 当作优先背景,但如果当前消息只是普通闲聊或泛话题,就按当前上下文自然回复,不要硬提 OpenClaw。"
[[group_profiles.profiles]]
mode = "social"
persona_id = "xiaoniu"
group_name_keywords = ["闲聊", "唠嗑", "水群","养生"]
knowledge_domain = "casual"
knowledge_focus = ["群当前话题", "轻松闲聊"]
reply_style = "更像群友,少一点技术说明"
interaction_tone = "熟人闲聊群,可以更松一点"
humor_style = "中等,可以带一点冷幽默"
sharpness_style = "允许轻微嘴欠,但别刺人"
expressiveness_style = "松弛一点,像随口接话"
address_style = "可以偶尔带昵称,像熟人群友顺手接一句,但别每次都叫人"
persona_overlay = "这里偏闲聊,小牛可以轻松一点,但仍然少说,不抢话,也别硬把技术群偏好带进来。"
[[group_profiles.profiles]]
mode = "dota"
persona_id = "xiaoniu"
group_name_keywords = ["dota", "dota2", "刀塔","强神"]
knowledge_domain = "dota"
knowledge_focus = ["Dota英雄", "对线理解", "出装节奏", "团战思路", "版本常识"]
reply_style = "像懂游戏的老群友,短句,不硬装解说"
interaction_tone = "老玩家聊天,允许一点损和调侃"
humor_style = "中等偏上,能接梗"
sharpness_style = "允许轻微毒舌,但别上头"
expressiveness_style = "松弛、像老群友拌嘴"
address_style = "可偶尔带外号或昵称,像老群友接茬,但频率别高,别像故意抖机灵"
persona_overlay = "这里如果聊到 Dota小牛可以自然带一点懂行感但别尬玩梗别写成长篇攻略。只有当前消息明显在聊 Dota 时才往这边靠;如果问题涉及最近战绩、实时战绩、最新对局数据,要委婉承认现在没法提取,不要编。"