变更项: 1. 新增 llm.scenes 场景路由层,支持 scene->backend 统一映射,并补充默认场景配置。 2. 扩展 LLMRegistry,新增 scene 解析逻辑;当声明 scene 时强制按场景路由结果生效,保持旧 backend 配置兼容。 3. 扩展后台 /api/system/llm_config 读写能力,支持 scenes 配置保存;新增插件 LLM 依赖扫描与拓扑数据输出。 4. 升级 system_llm 页面:新增场景路由管理区、插件依赖拓扑表,支持可视化查看 插件->scene->backend->provider。 5. 迁移核心插件配置到 scene 模式(保留兼容字段):dify/global_news/game_task/message_summary/ai_auto_response/member_context/douyu。 6. 调整部分插件初始化默认 llm_config,补充 scene 字段,确保后台场景切换可直接生效。
241 lines
8.5 KiB
TOML
241 lines
8.5 KiB
TOML
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 = 120
|
||
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 = 30
|
||
social_short_total_limit = 30
|
||
qa_fast_char_limit = 34
|
||
qa_fast_total_limit = 34
|
||
qa_with_context_sentence_limit = 2
|
||
qa_with_context_chunk_limit = 2
|
||
qa_with_context_char_limit = 32
|
||
qa_with_context_total_limit = 55
|
||
default_char_limit = 28
|
||
default_total_limit = 28
|
||
|
||
[prompt_compact]
|
||
group_profile_max_chars = 560
|
||
group_profile_max_lines = 10
|
||
context_max_chars = 900
|
||
context_max_lines = 18
|
||
recent_message_max_lines = 8
|
||
recent_message_line_max_chars = 60
|
||
at_member_profile_max_chars = 300
|
||
at_member_profile_max_lines = 8
|
||
member_memory_max_chars = 520
|
||
member_memory_max_lines = 12
|
||
memory_max_chars = 900
|
||
memory_max_lines = 18
|
||
strict_memory_relevance = true
|
||
|
||
[image]
|
||
recent_followup_window_minutes = 5
|
||
|
||
[priority]
|
||
at_bot = 1.0
|
||
explicit_question = 0.95
|
||
question_requires_at = true
|
||
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 时才往这边靠;如果问题涉及最近战绩、实时战绩、最新对局数据,要委婉承认现在没法提取,不要编。"
|