Skip to content

Commit 0f84df7

Browse files
authored
Merge pull request #1359 from Mai-with-u/dev
Dev0.11.2
2 parents b9b8c96 + 997183d commit 0f84df7

File tree

93 files changed

+8025
-5537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+8025
-5537
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ mongodb
77
napcat
88
docs/
99
.github/
10-
# test
10+
# test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ data/
22
data1/
33
mongodb/
44
NapCat.Framework.Windows.Once/
5+
NapCat.Framework.Windows.OneKey/
56
log/
67
logs/
78
out/
@@ -49,6 +50,7 @@ template/compare/model_config_template.toml
4950
(临时版)麦麦开始学习.bat
5051
src/plugins/utils/statistic.py
5152
CLAUDE.md
53+
MaiBot-Dashboard/
5254

5355
# Byte-compiled / optimized / DLL files
5456
__pycache__/

Dockerfile

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
1-
FROM python:3.13.5-slim-bookworm
1+
# 编译 LPMM
2+
FROM python:3.13-slim AS lpmm-builder
23
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
34

4-
# 工作目录
5-
WORKDIR /MaiMBot
5+
WORKDIR /MaiMBot-LPMM
66

7-
# 复制依赖列表
8-
COPY requirements.txt .
9-
# 同级目录下需要有 maim_message MaiMBot-LPMM
10-
#COPY maim_message /maim_message
7+
# 同级目录下需要有 MaiMBot-LPMM
118
COPY MaiMBot-LPMM /MaiMBot-LPMM
129

13-
# 编译器
10+
# 安装编译器和编译依赖
1411
RUN apt-get update && apt-get install -y build-essential
15-
16-
# lpmm编译安装
12+
RUN uv pip install --system --upgrade pip
1713
RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt
18-
RUN uv pip install --system Cython py-cpuinfo setuptools
14+
15+
# 编译 LPMM
1916
RUN cd /MaiMBot-LPMM/lib/quick_algo && python build_lib.py --cleanup --cythonize --install
2017

18+
# 运行环境
19+
FROM python:3.13-slim
20+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
21+
22+
# 工作目录
23+
WORKDIR /MaiMBot
24+
25+
# 复制依赖列表
26+
COPY requirements.txt .
27+
28+
# 从编译阶段复制 LPMM 编译结果
29+
COPY --from=lpmm-builder /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/
2130

22-
# 安装依赖
31+
# 安装运行时依赖
2332
RUN uv pip install --system --upgrade pip
24-
#RUN uv pip install --system -e /maim_message
2533
RUN uv pip install --system -r requirements.txt
2634

2735
# 复制项目代码
2836
COPY . .
2937

3038
EXPOSE 8000
3139

32-
ENTRYPOINT [ "python","bot.py" ]
40+
ENTRYPOINT [ "python","bot.py" ]

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
raise
3131

3232
# 最早期初始化日志系统,确保所有后续模块都使用正确的日志格式
33-
from src.common.logger import initialize_logging, get_logger, shutdown_logging
33+
from src.common.logger import initialize_logging, get_logger, shutdown_logging #noqa
3434

3535
initialize_logging()
3636

changelogs/changelog.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## [0.11.2] - 2025-11-15
4+
### 🌟 主要功能更改
5+
- "海马体Agent"记忆系统上线,最新最好的记忆系统,默认已接入lpmm
6+
- 添加黑话jargon学习系统
7+
- 添加群特殊Prompt系统
8+
- 优化直接提及时的回复速度
9+
10+
### 细节功能更改
11+
- 添加 WebUI 模块及相关 API 路由和 Token 管理功能
12+
- 可通过海马体Agent记录和查询群昵称
13+
- 添加聊天记录总结模块
14+
- 添加大量新统计指标
15+
16+
### 功能更改和修复
17+
- 移除表达方式学习上限限制
18+
- 移除部分未使用代码
19+
- 移除问题追踪和旧版记忆
20+
- 移除Exp+model表达方式,移除无用代码
21+
- 移除问题跟踪和记忆整理
22+
- 移除主动发言功能
23+
- 优化自我识别和情绪
24+
- 优化记忆提取能力
25+
- 优化planner,提及时消耗更少,连续no_reply时降低敏感度
26+
- 压缩1/3的planner消耗
27+
- 优化记忆检索占用
28+
- 优化记忆提取和聊天压缩
29+
- 优化错别字生成和分段
30+
- 优化log和添加changelog
31+
- 美化统计界面
32+
- 修正记忆提取LLM统计
33+
- 修复docker问题
34+
- 修复一些潜在问题
35+
- 修复bool和boolean问题
36+
- 修复超时给到所有信息的Bug
37+
- 修复回复超长现可返回原文
38+
- 修复私聊记忆
39+
- 修复prompt问题
40+
- 修复(bot): 恢复戳一戳正常响应
41+
- 提供更多细节debug配置
42+
343
## [0.11.1] - 2025-11-4
444
### 功能更改和修复
545
- 记忆现在能够被遗忘,并且拥有更好的合并

plugins/ChatFrequency/plugin.py

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from typing import List, Tuple, Type, Optional
2-
from src.plugin_system import (
3-
BasePlugin,
4-
register_plugin,
5-
BaseCommand,
6-
ComponentInfo,
7-
ConfigField
8-
)
2+
from src.plugin_system import BasePlugin, register_plugin, BaseCommand, ComponentInfo, ConfigField
93
from src.plugin_system.apis import send_api, frequency_api
104

5+
116
class SetTalkFrequencyCommand(BaseCommand):
127
"""设置当前聊天的talk_frequency值"""
8+
139
command_name = "set_talk_frequency"
1410
command_description = "设置当前聊天的talk_frequency值:/chat talk_frequency <数字> 或 /chat t <数字>"
1511
command_pattern = r"^/chat\s+(?:talk_frequency|t)\s+(?P<value>[+-]?\d*\.?\d+)$"
@@ -19,35 +15,35 @@ async def execute(self) -> Tuple[bool, Optional[str], bool]:
1915
# 获取命令参数 - 使用命名捕获组
2016
if not self.matched_groups or "value" not in self.matched_groups:
2117
return False, "命令格式错误", False
22-
18+
2319
value_str = self.matched_groups["value"]
2420
if not value_str:
2521
return False, "无法获取数值参数", False
26-
22+
2723
value = float(value_str)
28-
24+
2925
# 获取聊天流ID
3026
if not self.message.chat_stream or not hasattr(self.message.chat_stream, "stream_id"):
3127
return False, "无法获取聊天流信息", False
32-
28+
3329
chat_id = self.message.chat_stream.stream_id
34-
30+
3531
# 设置talk_frequency
3632
frequency_api.set_talk_frequency_adjust(chat_id, value)
37-
33+
3834
final_value = frequency_api.get_current_talk_value(chat_id)
3935
adjust_value = frequency_api.get_talk_frequency_adjust(chat_id)
4036
base_value = final_value / adjust_value
41-
37+
4238
# 发送反馈消息(不保存到数据库)
4339
await send_api.text_to_stream(
4440
f"已设置当前聊天的talk_frequency调整值为: {value}\n当前talk_value: {final_value:.2f}\n发言频率调整: {adjust_value:.2f}\n基础值: {base_value:.2f}",
4541
chat_id,
46-
storage_message=False
42+
storage_message=False,
4743
)
48-
44+
4945
return True, None, False
50-
46+
5147
except ValueError:
5248
error_msg = "数值格式错误,请输入有效的数字"
5349
await self.send_text(error_msg, storage_message=False)
@@ -60,6 +56,7 @@ async def execute(self) -> Tuple[bool, Optional[str], bool]:
6056

6157
class ShowFrequencyCommand(BaseCommand):
6258
"""显示当前聊天的频率控制状态"""
59+
6360
command_name = "show_frequency"
6461
command_description = "显示当前聊天的频率控制状态:/chat show 或 /chat s"
6562
command_pattern = r"^/chat\s+(?:show|s)$"
@@ -116,11 +113,7 @@ class BetterFrequencyPlugin(BasePlugin):
116113
config_file_name: str = "config.toml"
117114

118115
# 配置节描述
119-
config_section_descriptions = {
120-
"plugin": "插件基本信息",
121-
"frequency": "频率控制配置",
122-
"features": "功能开关配置"
123-
}
116+
config_section_descriptions = {"plugin": "插件基本信息", "frequency": "频率控制配置", "features": "功能开关配置"}
124117

125118
# 配置Schema定义
126119
config_schema: dict = {
@@ -138,13 +131,14 @@ class BetterFrequencyPlugin(BasePlugin):
138131

139132
def get_plugin_components(self) -> List[Tuple[ComponentInfo, Type]]:
140133
components = []
141-
134+
142135
# 根据配置决定是否注册命令组件
143136
if self.config.get("features", {}).get("enable_commands", True):
144-
components.extend([
145-
(SetTalkFrequencyCommand.get_command_info(), SetTalkFrequencyCommand),
146-
(ShowFrequencyCommand.get_command_info(), ShowFrequencyCommand),
147-
])
148-
149-
137+
components.extend(
138+
[
139+
(SetTalkFrequencyCommand.get_command_info(), SetTalkFrequencyCommand),
140+
(ShowFrequencyCommand.get_command_info(), ShowFrequencyCommand),
141+
]
142+
)
143+
150144
return components

plugins/deep_think/_manifest.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

plugins/deep_think/plugin.py

Lines changed: 0 additions & 102 deletions
This file was deleted.

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ structlog>=25.4.0
2525
toml>=0.10.2
2626
tomlkit>=0.13.3
2727
urllib3>=2.5.0
28-
uvicorn>=0.35.0
28+
uvicorn>=0.35.0
29+
msgpack
30+
zstandard

0 commit comments

Comments
 (0)