refactor: 重构配置模块
This commit is contained in:
@@ -1,104 +0,0 @@
|
||||
[inner.version]
|
||||
describe = "版本号"
|
||||
important = true
|
||||
can_edit = false
|
||||
|
||||
[bot.qq]
|
||||
describe = "机器人的QQ号"
|
||||
important = true
|
||||
can_edit = true
|
||||
|
||||
[bot.nickname]
|
||||
describe = "机器人的昵称"
|
||||
important = true
|
||||
can_edit = true
|
||||
|
||||
[bot.alias_names]
|
||||
describe = "机器人的别名列表,该选项还在调试中,暂时未生效"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[groups.talk_allowed]
|
||||
describe = "可以回复消息的群号码列表"
|
||||
important = true
|
||||
can_edit = true
|
||||
|
||||
[groups.talk_frequency_down]
|
||||
describe = "降低回复频率的群号码列表"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[groups.ban_user_id]
|
||||
describe = "禁止回复和读取消息的QQ号列表"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[personality.personality_core]
|
||||
describe = "用一句话或几句话描述人格的核心特点,建议20字以内"
|
||||
important = true
|
||||
can_edit = true
|
||||
|
||||
[personality.personality_sides]
|
||||
describe = "用一句话或几句话描述人格的一些细节,条数任意,不能为0,该选项还在调试中"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[identity.identity_detail]
|
||||
describe = "身份特点列表,条数任意,不能为0,该选项还在调试中"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[identity.age]
|
||||
describe = "年龄,单位岁"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[identity.gender]
|
||||
describe = "性别"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[identity.appearance]
|
||||
describe = "外貌特征描述,该选项还在调试中,暂时未生效"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[platforms.nonebot-qq]
|
||||
describe = "nonebot-qq适配器提供的链接"
|
||||
important = true
|
||||
can_edit = true
|
||||
|
||||
[chat.allow_focus_mode]
|
||||
describe = "是否允许专注聊天状态"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.base_normal_chat_num]
|
||||
describe = "最多允许多少个群进行普通聊天"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.base_focused_chat_num]
|
||||
describe = "最多允许多少个群进行专注聊天"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.observation_context_size]
|
||||
describe = "观察到的最长上下文大小,建议15,太短太长都会导致脑袋尖尖"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.message_buffer]
|
||||
describe = "启用消息缓冲器,启用此项以解决消息的拆分问题,但会使麦麦的回复延迟"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.ban_words]
|
||||
describe = "需要过滤的消息列表"
|
||||
important = false
|
||||
can_edit = true
|
||||
|
||||
[chat.ban_msgs_regex]
|
||||
describe = "需要过滤的消息(原始消息)匹配的正则表达式,匹配到的消息将被过滤(支持CQ码)"
|
||||
important = false
|
||||
can_edit = true
|
||||
@@ -1,18 +1,10 @@
|
||||
[inner]
|
||||
version = "1.7.0"
|
||||
version = "2.0.0"
|
||||
|
||||
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
||||
#如果你想要修改配置文件,请在修改后将version的值进行变更
|
||||
#如果新增项目,请在BotConfig类下新增相应的变量
|
||||
#1.如果你修改的是[]层级项目,例如你新增了 [memory],那么请在config.py的 load_config函数中的include_configs字典中新增"内容":{
|
||||
#"func":memory,
|
||||
#"support":">=0.0.0", #新的版本号
|
||||
#"necessary":False #是否必须
|
||||
#}
|
||||
#2.如果你修改的是[]下的项目,例如你新增了[memory]下的 memory_ban_words ,那么请在config.py的 load_config函数中的 memory函数下新增版本判断:
|
||||
# if config.INNER_VERSION in SpecifierSet(">=0.0.2"):
|
||||
# config.memory_ban_words = set(memory_config.get("memory_ban_words", []))
|
||||
|
||||
#如果新增项目,请阅读src/config/official_configs.py中的说明
|
||||
#
|
||||
# 版本格式:主版本号.次版本号.修订号,版本号递增规则如下:
|
||||
# 主版本号:当你做了不兼容的 API 修改,
|
||||
# 次版本号:当你做了向下兼容的功能性新增,
|
||||
@@ -21,11 +13,11 @@ version = "1.7.0"
|
||||
#----以上是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
||||
|
||||
[bot]
|
||||
qq = 1145141919810
|
||||
qq_account = 1145141919810
|
||||
nickname = "麦麦"
|
||||
alias_names = ["麦叠", "牢麦"] #该选项还在调试中,暂时未生效
|
||||
|
||||
[groups]
|
||||
[chat_target]
|
||||
talk_allowed = [
|
||||
123,
|
||||
123,
|
||||
@@ -53,10 +45,13 @@ identity_detail = [
|
||||
"身份特点",
|
||||
"身份特点",
|
||||
]# 条数任意,不能为0, 该选项还在调试中
|
||||
|
||||
#外貌特征
|
||||
age = 20 # 年龄 单位岁
|
||||
gender = "男" # 性别
|
||||
appearance = "用几句话描述外貌特征" # 外貌特征 该选项还在调试中,暂时未生效
|
||||
age = 18 # 年龄 单位岁
|
||||
gender = "女" # 性别
|
||||
height = "170" # 身高(单位cm)
|
||||
weight = "50" # 体重(单位kg)
|
||||
appearance = "用一句或几句话描述外貌特征" # 外貌特征 该选项还在调试中,暂时未生效
|
||||
|
||||
[platforms] # 必填项目,填写每个平台适配器提供的链接
|
||||
qq="http://127.0.0.1:18002/api/message"
|
||||
@@ -85,11 +80,10 @@ ban_msgs_regex = [
|
||||
|
||||
[normal_chat] #普通聊天
|
||||
#一般回复参数
|
||||
model_reasoning_probability = 0.7 # 麦麦回答时选择推理模型 模型的概率
|
||||
model_normal_probability = 0.3 # 麦麦回答时选择一般模型 模型的概率
|
||||
reasoning_model_probability = 0.3 # 麦麦回答时选择推理模型的概率(与之相对的,普通模型的概率为1 - reasoning_model_probability)
|
||||
|
||||
emoji_chance = 0.2 # 麦麦一般回复时使用表情包的概率,设置为1让麦麦自己决定发不发
|
||||
thinking_timeout = 100 # 麦麦最长思考时间,超过这个时间的思考会放弃(往往是api反应太慢)
|
||||
thinking_timeout = 120 # 麦麦最长思考时间,超过这个时间的思考会放弃(往往是api反应太慢)
|
||||
|
||||
willing_mode = "classical" # 回复意愿模式 —— 经典模式:classical,mxp模式:mxp,自定义模式:custom(需要你自己实现)
|
||||
response_willing_amplifier = 1 # 麦麦回复意愿放大系数,一般为1
|
||||
@@ -100,8 +94,8 @@ mentioned_bot_inevitable_reply = false # 提及 bot 必然回复
|
||||
at_bot_inevitable_reply = false # @bot 必然回复
|
||||
|
||||
[focus_chat] #专注聊天
|
||||
reply_trigger_threshold = 3.6 # 专注聊天触发阈值,越低越容易进入专注聊天
|
||||
default_decay_rate_per_second = 0.95 # 默认衰减率,越大衰减越快,越高越难进入专注聊天
|
||||
reply_trigger_threshold = 3.0 # 专注聊天触发阈值,越低越容易进入专注聊天
|
||||
default_decay_rate_per_second = 0.98 # 默认衰减率,越大衰减越快,越高越难进入专注聊天
|
||||
consecutive_no_reply_threshold = 3 # 连续不回复的阈值,越低越容易结束专注聊天
|
||||
|
||||
# 以下选项暂时无效
|
||||
@@ -110,20 +104,20 @@ compress_length_limit = 5 #最多压缩份数,超过该数值的压缩上下
|
||||
|
||||
|
||||
[emoji]
|
||||
max_emoji_num = 40 # 表情包最大数量
|
||||
max_reach_deletion = true # 开启则在达到最大数量时删除表情包,关闭则达到最大数量时不删除,只是不会继续收集表情包
|
||||
check_interval = 10 # 检查表情包(注册,破损,删除)的时间间隔(分钟)
|
||||
max_reg_num = 40 # 表情包最大注册数量
|
||||
do_replace = true # 开启则在达到最大数量时删除(替换)表情包,关闭则达到最大数量时不会继续收集表情包
|
||||
check_interval = 120 # 检查表情包(注册,破损,删除)的时间间隔(分钟)
|
||||
save_pic = false # 是否保存图片
|
||||
save_emoji = false # 是否保存表情包
|
||||
cache_emoji = true # 是否缓存表情包
|
||||
steal_emoji = true # 是否偷取表情包,让麦麦可以发送她保存的这些表情包
|
||||
enable_check = false # 是否启用表情包过滤,只有符合该要求的表情包才会被保存
|
||||
check_prompt = "符合公序良俗" # 表情包过滤要求,只有符合该要求的表情包才会被保存
|
||||
content_filtration = false # 是否启用表情包过滤,只有符合该要求的表情包才会被保存
|
||||
filtration_prompt = "符合公序良俗" # 表情包过滤要求,只有符合该要求的表情包才会被保存
|
||||
|
||||
[memory]
|
||||
build_memory_interval = 2000 # 记忆构建间隔 单位秒 间隔越低,麦麦学习越多,但是冗余信息也会增多
|
||||
build_memory_distribution = [6.0,3.0,0.6,32.0,12.0,0.4] # 记忆构建分布,参数:分布1均值,标准差,权重,分布2均值,标准差,权重
|
||||
build_memory_sample_num = 8 # 采样数量,数值越高记忆采样次数越多
|
||||
build_memory_sample_length = 40 # 采样长度,数值越高一段记忆内容越丰富
|
||||
memory_build_interval = 2000 # 记忆构建间隔 单位秒 间隔越低,麦麦学习越多,但是冗余信息也会增多
|
||||
memory_build_distribution = [6.0, 3.0, 0.6, 32.0, 12.0, 0.4] # 记忆构建分布,参数:分布1均值,标准差,权重,分布2均值,标准差,权重
|
||||
memory_build_sample_num = 8 # 采样数量,数值越高记忆采样次数越多
|
||||
memory_build_sample_length = 40 # 采样长度,数值越高一段记忆内容越丰富
|
||||
memory_compress_rate = 0.1 # 记忆压缩率 控制记忆精简程度 建议保持默认,调高可以获得更多信息,但是冗余信息也会增多
|
||||
|
||||
forget_memory_interval = 1000 # 记忆遗忘间隔 单位秒 间隔越低,麦麦遗忘越频繁,记忆更精简,但更难学习
|
||||
@@ -135,49 +129,45 @@ consolidation_similarity_threshold = 0.7 # 相似度阈值
|
||||
consolidation_check_percentage = 0.01 # 检查节点比例
|
||||
|
||||
#不希望记忆的词,已经记忆的不会受到影响
|
||||
memory_ban_words = [
|
||||
# "403","张三"
|
||||
]
|
||||
memory_ban_words = [ "表情包", "图片", "回复", "聊天记录" ]
|
||||
|
||||
[mood]
|
||||
mood_update_interval = 1.0 # 情绪更新间隔 单位秒
|
||||
mood_decay_rate = 0.95 # 情绪衰减率
|
||||
mood_intensity_factor = 1.0 # 情绪强度因子
|
||||
|
||||
[keywords_reaction] # 针对某个关键词作出反应
|
||||
[keyword_reaction] # 针对某个关键词作出反应
|
||||
enable = true # 关键词反应功能的总开关
|
||||
|
||||
[[keywords_reaction.rules]] # 如果想要新增多个关键词,直接复制本条,修改keywords和reaction即可
|
||||
[[keyword_reaction.rules]] # 如果想要新增多个关键词,直接复制本条,修改keywords和reaction即可
|
||||
enable = true # 是否启用此条(为了人类在未来AI战争能更好地识别AI(bushi),默认开启)
|
||||
keywords = ["人机", "bot", "机器", "入机", "robot", "机器人","ai","AI"] # 会触发反应的关键词
|
||||
reaction = "有人说你是人机或者机器人,否定这一事实,攻击或反问他。注意,只有认为你是机器人才回复,否则不要否认" # 触发之后添加的提示词
|
||||
|
||||
[[keywords_reaction.rules]] # 就像这样复制
|
||||
[[keyword_reaction.rules]] # 就像这样复制
|
||||
enable = false # 仅作示例,不会触发
|
||||
keywords = ["测试关键词回复","test",""]
|
||||
reaction = "回答“测试成功”" # 修复错误的引号
|
||||
|
||||
[[keywords_reaction.rules]] # 使用正则表达式匹配句式
|
||||
[[keyword_reaction.rules]] # 使用正则表达式匹配句式
|
||||
enable = false # 仅作示例,不会触发
|
||||
regex = ["^(?P<n>\\S{1,20})是这样的$"] # 将匹配到的词汇命名为n,反应中对应的[n]会被替换为匹配到的内容,若不了解正则表达式请勿编写
|
||||
reaction = "请按照以下模板造句:[n]是这样的,xx只要xx就可以,可是[n]要考虑的事情就很多了,比如什么时候xx,什么时候xx,什么时候xx。(请自由发挥替换xx部分,只需保持句式结构,同时表达一种将[n]过度重视的反讽意味)"
|
||||
|
||||
[chinese_typo]
|
||||
enable = true # 是否启用中文错别字生成器
|
||||
error_rate=0.001 # 单字替换概率
|
||||
error_rate=0.01 # 单字替换概率
|
||||
min_freq=9 # 最小字频阈值
|
||||
tone_error_rate=0.1 # 声调错误概率
|
||||
word_replace_rate=0.006 # 整词替换概率
|
||||
|
||||
[response_splitter]
|
||||
enable_response_splitter = true # 是否启用回复分割器
|
||||
response_max_length = 256 # 回复允许的最大长度
|
||||
response_max_sentence_num = 4 # 回复允许的最大句子数
|
||||
enable = true # 是否启用回复分割器
|
||||
max_length = 256 # 回复允许的最大长度
|
||||
max_sentence_num = 4 # 回复允许的最大句子数
|
||||
enable_kaomoji_protection = false # 是否启用颜文字保护
|
||||
|
||||
model_max_output_length = 256 # 模型单次返回的最大token数
|
||||
|
||||
[remote] #发送统计信息,主要是看全球有多少只麦麦
|
||||
[telemetry] #发送统计信息,主要是看全球有多少只麦麦
|
||||
enable = true
|
||||
|
||||
[experimental] #实验性功能
|
||||
@@ -194,14 +184,17 @@ pfc_chatting = false # 是否启用PFC聊天,该功能仅作用于私聊,与
|
||||
# stream = <true|false> : 用于指定模型是否是使用流式输出
|
||||
# 如果不指定,则该项是 False
|
||||
|
||||
[model]
|
||||
model_max_output_length = 800 # 模型单次返回的最大token数
|
||||
|
||||
#这个模型必须是推理模型
|
||||
[model.llm_reasoning] # 一般聊天模式的推理回复模型
|
||||
[model.reasoning] # 一般聊天模式的推理回复模型
|
||||
name = "Pro/deepseek-ai/DeepSeek-R1"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 1.0 #模型的输入价格(非必填,可以记录消耗)
|
||||
pri_out = 4.0 #模型的输出价格(非必填,可以记录消耗)
|
||||
|
||||
[model.llm_normal] #V3 回复模型 专注和一般聊天模式共用的回复模型
|
||||
[model.normal] #V3 回复模型 专注和一般聊天模式共用的回复模型
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 2 #模型的输入价格(非必填,可以记录消耗)
|
||||
@@ -209,13 +202,13 @@ pri_out = 8 #模型的输出价格(非必填,可以记录消耗)
|
||||
#默认temp 0.2 如果你使用的是老V3或者其他模型,请自己修改temp参数
|
||||
temp = 0.2 #模型的温度,新V3建议0.1-0.3
|
||||
|
||||
[model.llm_topic_judge] #主题判断模型:建议使用qwen2.5 7b
|
||||
[model.topic_judge] #主题判断模型:建议使用qwen2.5 7b
|
||||
name = "Pro/Qwen/Qwen2.5-7B-Instruct"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 0.35
|
||||
pri_out = 0.35
|
||||
|
||||
[model.llm_summary] #概括模型,建议使用qwen2.5 32b 及以上
|
||||
[model.summary] #概括模型,建议使用qwen2.5 32b 及以上
|
||||
name = "Qwen/Qwen2.5-32B-Instruct"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 1.26
|
||||
@@ -227,27 +220,27 @@ provider = "SILICONFLOW"
|
||||
pri_in = 0.35
|
||||
pri_out = 0.35
|
||||
|
||||
[model.llm_heartflow] # 用于控制麦麦是否参与聊天的模型
|
||||
[model.heartflow] # 用于控制麦麦是否参与聊天的模型
|
||||
name = "Qwen/Qwen2.5-32B-Instruct"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 1.26
|
||||
pri_out = 1.26
|
||||
|
||||
[model.llm_observation] #观察模型,压缩聊天内容,建议用免费的
|
||||
[model.observation] #观察模型,压缩聊天内容,建议用免费的
|
||||
# name = "Pro/Qwen/Qwen2.5-7B-Instruct"
|
||||
name = "Qwen/Qwen2.5-7B-Instruct"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 0
|
||||
pri_out = 0
|
||||
|
||||
[model.llm_sub_heartflow] #心流:认真水群时,生成麦麦的内心想法,必须使用具有工具调用能力的模型
|
||||
[model.sub_heartflow] #心流:认真水群时,生成麦麦的内心想法,必须使用具有工具调用能力的模型
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 2
|
||||
pri_out = 8
|
||||
temp = 0.3 #模型的温度,新V3建议0.1-0.3
|
||||
|
||||
[model.llm_plan] #决策:认真水群时,负责决定麦麦该做什么
|
||||
[model.plan] #决策:认真水群时,负责决定麦麦该做什么
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 2
|
||||
@@ -265,7 +258,7 @@ pri_out = 0
|
||||
#私聊PFC:需要开启PFC功能,默认三个模型均为硅基流动v3,如果需要支持多人同时私聊或频繁调用,建议把其中的一个或两个换成官方v3或其它模型,以免撞到429
|
||||
|
||||
#PFC决策模型
|
||||
[model.llm_PFC_action_planner]
|
||||
[model.pfc_action_planner]
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
temp = 0.3
|
||||
@@ -273,7 +266,7 @@ pri_in = 2
|
||||
pri_out = 8
|
||||
|
||||
#PFC聊天模型
|
||||
[model.llm_PFC_chat]
|
||||
[model.pfc_chat]
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
temp = 0.3
|
||||
@@ -281,7 +274,7 @@ pri_in = 2
|
||||
pri_out = 8
|
||||
|
||||
#PFC检查模型
|
||||
[model.llm_PFC_reply_checker]
|
||||
[model.pfc_reply_checker]
|
||||
name = "Pro/deepseek-ai/DeepSeek-V3"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 2
|
||||
@@ -294,7 +287,7 @@ pri_out = 8
|
||||
#以下模型暂时没有使用!!
|
||||
#以下模型暂时没有使用!!
|
||||
|
||||
[model.llm_tool_use] #工具调用模型,需要使用支持工具调用的模型,建议使用qwen2.5 32b
|
||||
[model.tool_use] #工具调用模型,需要使用支持工具调用的模型,建议使用qwen2.5 32b
|
||||
name = "Qwen/Qwen2.5-32B-Instruct"
|
||||
provider = "SILICONFLOW"
|
||||
pri_in = 1.26
|
||||
|
||||
Reference in New Issue
Block a user