update:修改版本号,修改默认max_token,修改hangelog
This commit is contained in:
@@ -2,20 +2,31 @@
|
||||
|
||||
## [0.11.0] - 2025-9-22
|
||||
### 🌟 主要功能更改
|
||||
- 重构记忆系统,新的记忆系统更可靠,记忆能力更强大
|
||||
- 麦麦好奇功能,麦麦会自主提出问题
|
||||
- 添加deepthink插件(默认关闭),让麦麦可以深度思考一些问题
|
||||
- 重构记忆系统,新的记忆系统更可靠,双通道查询,可以查询文本记忆和过去聊天记录
|
||||
- 主动发言功能,麦麦会自主提出问题(可精细调控频率)
|
||||
- 支持多重人格设定,可以随机切换成不同状态
|
||||
- 新增表达方式学习新模式,更少的占用
|
||||
- 添加表情包管理插件
|
||||
- 现可更好的支持多平台
|
||||
- 添加deepthink插件(默认关闭),让麦麦可以深度思考一些问题
|
||||
- 现已内置BetterFrequency插件
|
||||
|
||||
|
||||
### 细节功能更改
|
||||
- 修复配置文件转义问题
|
||||
- 情绪系统现在可以由配置文件控制开关
|
||||
- 修复平行动作控制失效的问题
|
||||
- 添加planner防抖,防止短时间快速消耗token
|
||||
- 优化planner历史状态记录
|
||||
- 修复吞字问题
|
||||
- 修复意外换行问题
|
||||
- 移除VLM的token限制
|
||||
- 为tool工具添加chat_id字段
|
||||
- 更新依赖表
|
||||
- 修复负载均衡
|
||||
- 优化了对gemini和不同模型的支持
|
||||
- 现统计模型名而不是模型标识符
|
||||
- 修改默认推荐模型为ds v3.2
|
||||
- 优化了对gemini和不同模型的支持,优化了对gemini搜索的支持
|
||||
|
||||
## [0.10.3] - 2025-9-22
|
||||
### 🌟 主要功能更改
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
from typing import Tuple
|
||||
|
||||
# 导入新插件系统
|
||||
from src.plugin_system import BaseAction, ActionActivationType
|
||||
|
||||
# 导入依赖的系统组件
|
||||
from src.common.logger import get_logger
|
||||
|
||||
# 导入API模块
|
||||
from src.plugin_system.apis import frequency_api, send_api, config_api, generator_api
|
||||
|
||||
logger = get_logger("frequency_adjust")
|
||||
|
||||
|
||||
class FrequencyAdjustAction(BaseAction):
|
||||
"""频率调节动作 - 调整聊天发言频率"""
|
||||
|
||||
activation_type = ActionActivationType.LLM_JUDGE
|
||||
parallel_action = False
|
||||
|
||||
# 动作基本信息
|
||||
action_name = "frequency_adjust"
|
||||
|
||||
action_description = "调整当前聊天的发言频率"
|
||||
|
||||
# 动作参数定义
|
||||
action_parameters = {
|
||||
"direction": "调整方向:'increase'(增加)或'decrease'(降低)",
|
||||
}
|
||||
|
||||
# 动作使用场景
|
||||
bot_name = config_api.get_global_config("bot.nickname")
|
||||
|
||||
|
||||
action_require = [
|
||||
f"当用户提到 {bot_name} 太安静或太活跃时使用",
|
||||
f"有人提到 {bot_name} 的发言太多或太少",
|
||||
f"需要根据聊天氛围调整 {bot_name} 的活跃度",
|
||||
]
|
||||
|
||||
# 关联类型
|
||||
associated_types = ["text"]
|
||||
|
||||
async def execute(self) -> Tuple[bool, str]:
|
||||
"""执行频率调节动作"""
|
||||
try:
|
||||
# 1. 获取动作参数
|
||||
direction = self.action_data.get("direction")
|
||||
# multiply = 1.2
|
||||
# multiply = self.action_data.get("multiply")
|
||||
|
||||
if not direction:
|
||||
error_msg = "缺少必要的参数:direction或multiply"
|
||||
logger.error(f"{self.log_prefix} {error_msg}")
|
||||
return False, error_msg
|
||||
|
||||
# 2. 获取当前频率值
|
||||
current_frequency = frequency_api.get_current_talk_value(self.chat_id)
|
||||
|
||||
# 3. 计算新的频率值(使用比率而不是绝对值)
|
||||
# calculated_frequency = current_frequency * multiply
|
||||
if direction == "increase":
|
||||
calculated_frequency = current_frequency * 1.2
|
||||
if calculated_frequency > 1.0:
|
||||
new_frequency = 1.0
|
||||
action_desc = f"增加到最大值"
|
||||
# 记录超出限制的action
|
||||
logger.warning(f"{self.log_prefix} 尝试调整频率超出最大值: current={current_frequency:.2f}, calculated={calculated_frequency:.2f}")
|
||||
await self.store_action_info(
|
||||
action_build_into_prompt=True,
|
||||
action_prompt_display=f"你尝试调整发言频率到{calculated_frequency:.2f},但最大值只能为1.0,已设置为最大值",
|
||||
action_done=True,
|
||||
)
|
||||
return True, f"调整发言频率超出限制: {current_frequency:.2f} → {new_frequency:.2f}"
|
||||
else:
|
||||
new_frequency = calculated_frequency
|
||||
action_desc = f"增加"
|
||||
elif direction == "decrease":
|
||||
calculated_frequency = current_frequency * 0.8
|
||||
new_frequency = max(0.0, calculated_frequency)
|
||||
action_desc = f"降低"
|
||||
else:
|
||||
error_msg = f"无效的调整方向: {direction}"
|
||||
logger.error(f"{self.log_prefix} {error_msg}")
|
||||
return False, error_msg
|
||||
|
||||
# 4. 设置新的频率值
|
||||
frequency_api.set_talk_frequency_adjust(self.chat_id, new_frequency)
|
||||
|
||||
# 5. 发送反馈消息
|
||||
feedback_msg = f"已{action_desc}发言频率:{current_frequency:.2f} → {new_frequency:.2f}"
|
||||
result_status, data = await generator_api.rewrite_reply(
|
||||
chat_stream=self.chat_stream,
|
||||
reply_data={
|
||||
"raw_reply": feedback_msg,
|
||||
"reason": "表达自己已经调整了发言频率,不一定要说具体数值,可以有趣一些",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
if result_status:
|
||||
for reply_seg in data.reply_set.reply_data:
|
||||
send_data = reply_seg.content
|
||||
await self.send_text(send_data)
|
||||
logger.info(f"{self.log_prefix} {send_data}")
|
||||
|
||||
# 6. 存储动作信息(仅在未超出限制时)
|
||||
if calculated_frequency <= 1.0:
|
||||
await self.store_action_info(
|
||||
action_build_into_prompt=True,
|
||||
action_prompt_display=f"你{action_desc}了发言频率,从{current_frequency:.2f}调整到{new_frequency:.2f}",
|
||||
action_done=True,
|
||||
)
|
||||
|
||||
return True, f"成功调整发言频率: {current_frequency:.2f} → {new_frequency:.2f}"
|
||||
|
||||
except Exception as e:
|
||||
error_msg = f"频率调节失败: {str(e)}"
|
||||
logger.error(f"{self.log_prefix} {error_msg}", exc_info=True)
|
||||
await self.send_text("频率调节失败")
|
||||
return False, error_msg
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import List, Tuple, Type, Any, Optional
|
||||
from typing import List, Tuple, Type, Optional
|
||||
from src.plugin_system import (
|
||||
BasePlugin,
|
||||
register_plugin,
|
||||
@@ -7,8 +7,6 @@ from src.plugin_system import (
|
||||
ConfigField
|
||||
)
|
||||
from src.plugin_system.apis import send_api, frequency_api
|
||||
from .frequency_adjust_action import FrequencyAdjustAction
|
||||
|
||||
|
||||
class SetTalkFrequencyCommand(BaseCommand):
|
||||
"""设置当前聊天的talk_frequency值"""
|
||||
@@ -136,10 +134,6 @@ class BetterFrequencyPlugin(BasePlugin):
|
||||
"max_adjust_value": ConfigField(type=float, default=1.0, description="最大调整值"),
|
||||
"min_adjust_value": ConfigField(type=float, default=0.0, description="最小调整值"),
|
||||
},
|
||||
# "features": {
|
||||
# "enable_frequency_adjust_action": ConfigField(type=bool, default=False, description="是否启用频率调节动作(FrequencyAdjustAction)"),
|
||||
# "enable_commands": ConfigField(type=bool, default=True, description="是否启用命令功能(/chat命令)"),
|
||||
# }
|
||||
}
|
||||
|
||||
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
|
||||
@@ -152,8 +146,5 @@ class BetterFrequencyPlugin(BasePlugin):
|
||||
(ShowFrequencyCommand.get_command_info(), ShowFrequencyCommand),
|
||||
])
|
||||
|
||||
# 根据配置决定是否注册频率调节动作组件
|
||||
# if self.config.get("features", {}).get("enable_frequency_adjust_action", True):
|
||||
# components.append((FrequencyAdjustAction.get_action_info(), FrequencyAdjustAction))
|
||||
|
||||
return components
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -98,8 +98,8 @@ class FrequencyControl:
|
||||
prompt,
|
||||
)
|
||||
|
||||
logger.info(f"频率调整 prompt: {prompt}")
|
||||
logger.info(f"频率调整 response: {response}")
|
||||
# logger.info(f"频率调整 prompt: {prompt}")
|
||||
# logger.info(f"频率调整 response: {response}")
|
||||
|
||||
if global_config.debug.show_prompt:
|
||||
logger.info(f"频率调整 prompt: {prompt}")
|
||||
|
||||
@@ -133,7 +133,7 @@ class DefaultReplyer:
|
||||
|
||||
try:
|
||||
content, reasoning_content, model_name, tool_call = await self.llm_generate_content(prompt)
|
||||
logger.debug(f"replyer生成内容: {content}")
|
||||
# logger.debug(f"replyer生成内容: {content}")
|
||||
|
||||
logger.info(f"replyer生成内容: {content}")
|
||||
logger.info(f"replyer生成推理: {reasoning_content}")
|
||||
@@ -998,7 +998,7 @@ class DefaultReplyer:
|
||||
async def llm_generate_content(self, prompt: str):
|
||||
with Timer("LLM生成", {}): # 内部计时器,可选保留
|
||||
# 直接使用已初始化的模型实例
|
||||
logger.info(f"\n{prompt}\n")
|
||||
# logger.info(f"\n{prompt}\n")
|
||||
|
||||
if global_config.debug.show_prompt:
|
||||
logger.info(f"\n{prompt}\n")
|
||||
|
||||
@@ -55,7 +55,7 @@ TEMPLATE_DIR = os.path.join(PROJECT_ROOT, "template")
|
||||
|
||||
# 考虑到,实际上配置文件中的mai_version是不会自动更新的,所以采用硬编码
|
||||
# 对该字段的更新,请严格参照语义化版本规范:https://semver.org/lang/zh-CN/
|
||||
MMC_VERSION = "0.11.0-snapshot.3"
|
||||
MMC_VERSION = "0.11.0"
|
||||
|
||||
|
||||
def get_key_comment(toml_table, key):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[inner]
|
||||
version = "1.7.6"
|
||||
version = "1.7.7"
|
||||
|
||||
# 配置文件版本号迭代规则同bot_config.toml
|
||||
|
||||
@@ -121,7 +121,7 @@ max_tokens = 800
|
||||
[model_task_config.replyer] # 首要回复模型,还用于表达器和表达方式学习
|
||||
model_list = ["siliconflow-deepseek-v3.2-think","siliconflow-deepseek-r1","siliconflow-deepseek-v3.2"]
|
||||
temperature = 0.3 # 模型温度,新V3建议0.1-0.3
|
||||
max_tokens = 800
|
||||
max_tokens = 2048
|
||||
|
||||
[model_task_config.planner] #决策:负责决定麦麦该什么时候回复的模型
|
||||
model_list = ["siliconflow-deepseek-v3.2"]
|
||||
|
||||
Reference in New Issue
Block a user