From 6b08285402bbb0a9e2b66b3320cc09021a500072 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Fri, 25 Jul 2025 15:28:22 +0800 Subject: [PATCH 1/7] =?UTF-8?q?workflow=E4=B8=B4=E6=97=B6=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 47fdf5b7..36f5ba8f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,16 +1,21 @@ name: Docker Build and Push on: - push: + # push: + # branches: + # - main + # - classical + # - dev + # tags: + # - "v*.*.*" + # - "v*" + # - "*.*.*" + # - "*.*.*-*" + workflow_dispatch: # 允许手动触发工作流 branches: - main - - classical - dev - tags: - - "v*.*.*" - - "v*" - - "*.*.*" - - "*.*.*-*" + - dev-refactor # Workflow's jobs jobs: From 070f15fa0c4305d63dbbfb5a28dd3bb521279544 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Fri, 25 Jul 2025 15:58:01 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=94=B9=E6=88=90=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=98=B2=E6=AD=A2=E4=B9=B1=E4=B8=83=E5=85=AB?= =?UTF-8?q?=E7=B3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/built_in/plugin_management/plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/built_in/plugin_management/plugin.py b/src/plugins/built_in/plugin_management/plugin.py index 67e2a5f6..866899de 100644 --- a/src/plugins/built_in/plugin_management/plugin.py +++ b/src/plugins/built_in/plugin_management/plugin.py @@ -18,7 +18,6 @@ class ManagementCommand(BaseCommand): command_name: str = "management" description: str = "管理命令" command_pattern: str = r"(?P^/pm(\s[a-zA-Z0-9_]+)*\s*$)" - intercept_message: bool = True async def execute(self) -> Tuple[bool, str]: # sourcery skip: merge-duplicate-blocks @@ -423,13 +422,13 @@ class ManagementCommand(BaseCommand): @register_plugin class PluginManagementPlugin(BasePlugin): plugin_name: str = "plugin_management_plugin" - enable_plugin: bool = True + enable_plugin: bool = False dependencies: list[str] = [] python_dependencies: list[str] = [] config_file_name: str = "config.toml" config_schema: dict = { "plugin": { - "enable": ConfigField(bool, default=True, description="是否启用插件"), + "enable": ConfigField(bool, default=False, description="是否启用插件"), "permission": ConfigField(list, default=[], description="有权限使用插件管理命令的用户列表"), }, } From c10a0a1d783378a339a47ccf33c39fd6d4340fcf Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Jul 2025 17:38:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddocker-image.yml?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=88=86=E6=94=AF=E5=92=8C=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=8F=96=E6=B6=88qemu=E6=9B=B4?= =?UTF-8?q?=E6=96=B0arm=E6=9C=8D=E5=8A=A1=E5=99=A8=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=96=B0docker-compose.yml=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 31 +++++++++++------------------- docker-compose.yml | 1 + 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 36f5ba8f..fb514291 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,27 +1,23 @@ name: Docker Build and Push on: - # push: - # branches: - # - main - # - classical - # - dev - # tags: - # - "v*.*.*" - # - "v*" - # - "*.*.*" - # - "*.*.*-*" - workflow_dispatch: # 允许手动触发工作流 + push: branches: - main + - classical - dev - - dev-refactor + tags: + - "v*.*.*" + - "v*" + - "*.*.*" + - "*.*.*-*" + workflow_dispatch: # 允许手动触发工作流 # Workflow's jobs jobs: build-amd64: name: Build AMD64 Image - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: digest: ${{ steps.build.outputs.digest }} steps: @@ -74,7 +70,7 @@ jobs: build-arm64: name: Build ARM64 Image - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm outputs: digest: ${{ steps.build.outputs.digest }} steps: @@ -90,11 +86,6 @@ jobs: - name: Clone lpmm run: git clone https://github.com/MaiM-with-u/MaiMBot-LPMM.git MaiMBot-LPMM - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -132,7 +123,7 @@ jobs: create-manifest: name: Create Multi-Arch Manifest - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: - build-amd64 - build-arm64 diff --git a/docker-compose.yml b/docker-compose.yml index e4519d30..3bcf0e54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,6 +84,7 @@ services: # - ./data/MaiMBot:/data/MaiMBot # networks: # - maim_bot + volumes: site-packages: networks: From 39891eef6dd78b97fa998aadbf0269cabcef7256 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Mon, 28 Jul 2025 09:46:40 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E4=BD=BF=E7=94=A8=E7=9B=B8=E5=AF=B9=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E4=BC=9A=E7=88=86=E7=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin_system/core/plugin_manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugin_system/core/plugin_manager.py b/src/plugin_system/core/plugin_manager.py index 98bce4bd..dfafda18 100644 --- a/src/plugin_system/core/plugin_manager.py +++ b/src/plugin_system/core/plugin_manager.py @@ -289,6 +289,7 @@ class PluginManager: return False module = module_from_spec(spec) + module.__package__ = module_name # 设置模块包名 spec.loader.exec_module(module) logger.debug(f"插件模块加载成功: {plugin_file}") From c28e9647471552ce8e2ee63fef9e9e2c5ffc432a Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Mon, 18 Aug 2025 13:00:35 +0800 Subject: [PATCH 5/7] final --- test_del_memory.py | 73 ---------------------- test_fix_memory_points.py | 124 -------------------------------------- 2 files changed, 197 deletions(-) delete mode 100644 test_del_memory.py delete mode 100644 test_fix_memory_points.py diff --git a/test_del_memory.py b/test_del_memory.py deleted file mode 100644 index 523ad156..00000000 --- a/test_del_memory.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -测试del_memory函数的脚本 -""" - -import sys -import os - -# 添加src目录到Python路径 -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) - -from person_info.person_info import Person - -def test_del_memory(): - """测试del_memory函数""" - print("开始测试del_memory函数...") - - # 创建一个测试用的Person实例(不连接数据库) - person = Person.__new__(Person) - person.person_id = "test_person" - person.memory_points = [ - "性格:这个人很友善:5.0", - "性格:这个人很友善:4.0", - "爱好:喜欢打游戏:3.0", - "爱好:喜欢打游戏:2.0", - "工作:是一名程序员:1.0", - "性格:这个人很友善:6.0" - ] - - print(f"原始记忆点数量: {len(person.memory_points)}") - print("原始记忆点:") - for i, memory in enumerate(person.memory_points): - print(f" {i+1}. {memory}") - - # 测试删除"性格"分类中"这个人很友善"的记忆 - print("\n测试1: 删除'性格'分类中'这个人很友善'的记忆") - deleted_count = person.del_memory("性格", "这个人很友善") - print(f"删除了 {deleted_count} 个记忆点") - print("删除后的记忆点:") - for i, memory in enumerate(person.memory_points): - print(f" {i+1}. {memory}") - - # 测试删除"爱好"分类中"喜欢打游戏"的记忆 - print("\n测试2: 删除'爱好'分类中'喜欢打游戏'的记忆") - deleted_count = person.del_memory("爱好", "喜欢打游戏") - print(f"删除了 {deleted_count} 个记忆点") - print("删除后的记忆点:") - for i, memory in enumerate(person.memory_points): - print(f" {i+1}. {memory}") - - # 测试相似度匹配 - print("\n测试3: 测试相似度匹配") - person.memory_points = [ - "性格:这个人非常友善:5.0", - "性格:这个人很友善:4.0", - "性格:这个人友善:3.0" - ] - print("原始记忆点:") - for i, memory in enumerate(person.memory_points): - print(f" {i+1}. {memory}") - - # 删除"这个人很友善"(应该匹配"这个人很友善"和"这个人友善") - deleted_count = person.del_memory("性格", "这个人很友善", similarity_threshold=0.8) - print(f"删除了 {deleted_count} 个记忆点") - print("删除后的记忆点:") - for i, memory in enumerate(person.memory_points): - print(f" {i+1}. {memory}") - - print("\n测试完成!") - -if __name__ == "__main__": - test_del_memory() diff --git a/test_fix_memory_points.py b/test_fix_memory_points.py deleted file mode 100644 index bf351463..00000000 --- a/test_fix_memory_points.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -测试修复后的memory_points处理 -""" - -import sys -import os - -# 添加src目录到Python路径 -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) - -from person_info.person_info import Person - -def test_memory_points_with_none(): - """测试包含None值的memory_points处理""" - print("测试包含None值的memory_points处理...") - - # 创建一个测试Person实例 - person = Person(person_id="test_user_123") - - # 模拟包含None值的memory_points - person.memory_points = [ - "喜好:喜欢咖啡:1.0", - None, # 模拟None值 - "性格:开朗:1.0", - None, # 模拟另一个None值 - "兴趣:编程:1.0" - ] - - print(f"原始memory_points: {person.memory_points}") - - # 测试get_all_category方法 - try: - categories = person.get_all_category() - print(f"获取到的分类: {categories}") - print("✓ get_all_category方法正常工作") - except Exception as e: - print(f"✗ get_all_category方法出错: {e}") - return False - - # 测试get_memory_list_by_category方法 - try: - memories = person.get_memory_list_by_category("喜好") - print(f"获取到的喜好记忆: {memories}") - print("✓ get_memory_list_by_category方法正常工作") - except Exception as e: - print(f"✗ get_memory_list_by_category方法出错: {e}") - return False - - # 测试del_memory方法 - try: - deleted_count = person.del_memory("喜好", "喜欢咖啡") - print(f"删除的记忆点数量: {deleted_count}") - print(f"删除后的memory_points: {person.memory_points}") - print("✓ del_memory方法正常工作") - except Exception as e: - print(f"✗ del_memory方法出错: {e}") - return False - - return True - -def test_memory_points_empty(): - """测试空的memory_points处理""" - print("\n测试空的memory_points处理...") - - person = Person(person_id="test_user_456") - person.memory_points = [] - - try: - categories = person.get_all_category() - print(f"空列表的分类: {categories}") - print("✓ 空列表处理正常") - except Exception as e: - print(f"✗ 空列表处理出错: {e}") - return False - - try: - memories = person.get_memory_list_by_category("测试分类") - print(f"空列表的记忆: {memories}") - print("✓ 空列表分类查询正常") - except Exception as e: - print(f"✗ 空列表分类查询出错: {e}") - return False - - return True - -def test_memory_points_all_none(): - """测试全部为None的memory_points处理""" - print("\n测试全部为None的memory_points处理...") - - person = Person(person_id="test_user_789") - person.memory_points = [None, None, None] - - try: - categories = person.get_all_category() - print(f"全None列表的分类: {categories}") - print("✓ 全None列表处理正常") - except Exception as e: - print(f"✗ 全None列表处理出错: {e}") - return False - - try: - memories = person.get_memory_list_by_category("测试分类") - print(f"全None列表的记忆: {memories}") - print("✓ 全None列表分类查询正常") - except Exception as e: - print(f"✗ 全None列表分类查询出错: {e}") - return False - - return True - -if __name__ == "__main__": - print("开始测试修复后的memory_points处理...") - - success = True - success &= test_memory_points_with_none() - success &= test_memory_points_empty() - success &= test_memory_points_all_none() - - if success: - print("\n🎉 所有测试通过!memory_points的None值处理已修复。") - else: - print("\n❌ 部分测试失败,需要进一步检查。") From 6dba76b7bc9cc05c3c5aaea9fca632ad551f97e2 Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Mon, 18 Aug 2025 14:50:30 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme=20=E5=92=8Cchanglo?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++-- changelogs/changelog.md | 67 ++++++++++++++++++++++++++++-- src/chat/chat_loop/heartFC_chat.py | 2 +- 3 files changed, 67 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3a9e14f8..11c71c2a 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ **🍔MaiCore 是一个基于大语言模型的可交互智能体** -- 💭 **智能对话系统**:基于 LLM 的自然语言交互,支持normal和focus统一化处理。 -- 🔌 **强大插件系统**:全面重构的插件架构,支持完整的管理API和权限控制。 +- 💭 **智能对话系统**:基于 LLM 的自然语言交互,聊天时机控制。 +- 🔌 **强大插件系统**:全面重构的插件架构,更多API。 - 🤔 **实时思维系统**:模拟人类思考过程。 - 🧠 **表达学习功能**:学习群友的说话风格和表达方式 - 💝 **情感表达系统**:情绪系统和表情包系统。 @@ -46,7 +46,7 @@ ## 🔥 更新和安装 -**最新版本: v0.9.1** ([更新日志](changelogs/changelog.md)) +**最新版本: v0.10.0** ([更新日志](changelogs/changelog.md)) 可前往 [Release](https://github.com/MaiM-with-u/MaiBot/releases/) 页面下载最新版本 可前往 [启动器发布页面](https://github.com/MaiM-with-u/mailauncher/releases/)下载最新启动器 @@ -56,7 +56,6 @@ - `classical`: 旧版本(停止维护) ### 最新版本部署教程 -- [从0.6/0.7升级须知](https://docs.mai-mai.org/faq/maibot/update_to_07.html) - [🚀 最新版本部署教程](https://docs.mai-mai.org/manual/deployment/mmc_deploy_windows.html) - 基于 MaiCore 的新版本部署方式(与旧版本不兼容) > [!WARNING] @@ -64,7 +63,6 @@ > - 项目处于活跃开发阶段,功能和 API 可能随时调整。 > - 文档未完善,有问题可以提交 Issue 或者 Discussion。 > - QQ 机器人存在被限制风险,请自行了解,谨慎使用。 -> - 由于持续迭代,可能存在一些已知或未知的 bug。 > - 由于程序处于开发中,可能消耗较多 token。 ## 💬 讨论 diff --git a/changelogs/changelog.md b/changelogs/changelog.md index 00cb7ca9..b37e0d52 100644 --- a/changelogs/changelog.md +++ b/changelogs/changelog.md @@ -1,16 +1,75 @@ # Changelog ## [0.10.0] - 2025-7-1 -### 主要功能更改 +### 🌟 主要功能更改 +- 优化的回复生成,现在的回复对上下文把控更加精准 +- 新的回复逻辑控制,现在合并了normal和focus模式,更加统一 +- 优化表达方式系统,现在学习和使用更加精准 +- 新的关系系统,现在的关系构建更精准也更克制 - 工具系统重构,现在合并到了插件系统中 - 彻底重构了整个LLM Request了,现在支持模型轮询和更多灵活的参数 - 同时重构了整个模型配置系统,升级需要重新配置llm配置文件 - 随着LLM Request的重构,插件系统彻底重构完成。插件系统进入稳定状态,仅增加新的API - 具体相比于之前的更改可以查看[changes.md](./changes.md) -### 细节优化 -- 修复了lint爆炸的问题,代码更加规范了 -- 修改了log的颜色,更加护眼 +#### 🔧 工具系统重构 +- **工具系统整合**: 工具系统现在完全合并到插件系统中,提供统一的扩展能力 +- **工具启用控制**: 支持配置是否启用特定工具,提供更人性化的直接调用方式 +- **配置文件读取**: 工具现在支持读取配置文件,增强配置灵活性 + +#### 🚀 LLM系统全面重构 +- **LLM Request重构**: 彻底重构了整个LLM Request系统,现在支持模型轮询和更多灵活的参数 +- **模型配置升级**: 同时重构了整个模型配置系统,升级需要重新配置llm配置文件 +- **任务类型支持**: 新增任务类型和能力字段至模型配置,增强模型初始化逻辑 +- **异常处理增强**: 增强LLMRequest类的异常处理,添加统一的模型异常处理方法 + +#### 🔌 插件系统稳定化 +- **插件系统重构完成**: 随着LLM Request的重构,插件系统彻底重构完成,进入稳定状态 +- **API扩展**: 仅增加新的API,保持向后兼容性 +- **插件管理优化**: 让插件管理配置真正有用,提升管理体验 + +#### 💾 记忆系统优化 +- **及时构建**: 记忆系统再优化,现在及时构建,并且不会重复构建 +- **精确提取**: 记忆提取更精确,提升记忆质量 + +#### 🎭 表达方式系统 +- **表达方式记录**: 记录使用的表达方式,提供更好的学习追踪 +- **学习优化**: 优化表达方式提取,修复表达学习出错问题 +- **配置优化**: 优化表达方式配置和逻辑,提升系统稳定性 + +#### 🔄 聊天系统统一 +- **normal和focus合并**: 彻底合并normal和focus,完全基于planner决定target message +- **no_reply内置**: 将no_reply功能移动到主循环中,简化系统架构 +- **回复优化**: 优化reply,填补缺失值,让麦麦可以回复自己的消息 +- **频率控制API**: 加入聊天频率控制相关API,提供更精细的控制 + +#### 日志系统改进 +- **日志颜色优化**: 修改了log的颜色,更加护眼 +- **日志清理优化**: 修复了日志清理先等24h的问题,提升系统性能 +- **计时定位**: 通过计时定位LLM异常延时,提升问题排查效率 + +### 🐛 问题修复 + +#### 代码质量提升 +- **lint问题修复**: 修复了lint爆炸的问题,代码更加规范了 +- **导入优化**: 修复导入爆炸和文档错误,优化代码结构 + +#### 系统稳定性 +- **循环导入**: 修复了import时循环导入的问题 +- **并行动作**: 修复并行动作炸裂问题,提升并发处理能力 +- **空响应处理**: 空响应就raise,避免系统异常 + +#### 功能修复 +- **API问题**: 修复api问题,提升系统可用性 +- **notice问题**: 为组件方法提供新参数,暂时解决notice问题 +- **关系构建**: 修复不认识的用户构建关系问题 +- **流式解析**: 修复流式解析越界问题,避免空choices的SSE帧错误 + +#### 配置和兼容性 +- **默认值**: 添加默认值,提升配置灵活性 +- **类型问题**: 修复类型问题,提升代码健壮性 +- **配置加载**: 优化配置加载逻辑,提升系统启动稳定性 + ## [0.9.1] - 2025-7-26 diff --git a/src/chat/chat_loop/heartFC_chat.py b/src/chat/chat_loop/heartFC_chat.py index fff409bc..b97243f9 100644 --- a/src/chat/chat_loop/heartFC_chat.py +++ b/src/chat/chat_loop/heartFC_chat.py @@ -359,7 +359,7 @@ class HeartFChatting: x0 = 1.0 # 控制曲线中心点 return 1.0 / (1.0 + math.exp(-k * (interest_val - x0))) - normal_mode_probability = calculate_normal_mode_probability(interest_value) * 0.5 / self.talk_frequency_control.get_current_talk_frequency() + normal_mode_probability = calculate_normal_mode_probability(interest_value) * 2 * self.talk_frequency_control.get_current_talk_frequency() # 根据概率决定使用哪种模式 if random.random() < normal_mode_probability: From d919c34adb6647728d2ddc6936c45ee9b3d55008 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Mon, 18 Aug 2025 15:14:07 +0800 Subject: [PATCH 7/7] =?UTF-8?q?changelog=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelogs/changelog.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/changelogs/changelog.md b/changelogs/changelog.md index b37e0d52..1b4d18e3 100644 --- a/changelogs/changelog.md +++ b/changelogs/changelog.md @@ -9,8 +9,7 @@ - 工具系统重构,现在合并到了插件系统中 - 彻底重构了整个LLM Request了,现在支持模型轮询和更多灵活的参数 - 同时重构了整个模型配置系统,升级需要重新配置llm配置文件 -- 随着LLM Request的重构,插件系统彻底重构完成。插件系统进入稳定状态,仅增加新的API - - 具体相比于之前的更改可以查看[changes.md](./changes.md) +- **警告所有插件开发者:插件系统即将迎来不稳定时期,随时会发动更改。** #### 🔧 工具系统重构 - **工具系统整合**: 工具系统现在完全合并到插件系统中,提供统一的扩展能力