Commit Graph

126 Commits

Author SHA1 Message Date
雅诺狐
bb4592846c Refactor config system to use Pydantic validation
Refactored configuration classes to inherit from a new ValidatedConfigBase using Pydantic for robust validation and error reporting. Updated api_ada_configs.py, config.py, config_base.py, and official_configs.py to replace dataclasses with Pydantic models, add field validation, and improve error messages. This change enhances configuration reliability and developer feedback for misconfigurations. Also includes minor code cleanups and removal of unused variables in other modules.
2025-11-19 22:44:45 +08:00
minecraft1024a
97ece6524c refactor(utils): 移除自定义加权随机函数并改用 random.choices
将原先在 `bot.py` 中实现的 `weighted_choice` 函数移除,并在 `src/main.py` 中改用 Python 内置的 `random.choices` 函数来实现启动时彩蛋的加权随机选择。

这一更改简化了代码,提高了可读性,并利用了标准库的优化实现。同时调整了彩蛋文本和对应的权重。
2025-11-19 22:44:41 +08:00
雅诺狐
6e4047c807 Add rare easter egg message and adjust weights
Introduced a new rare easter egg message to the items list and updated the selection weights to make the new message extremely rare while adjusting the probabilities of the existing messages.
2025-11-19 22:44:41 +08:00
ikun两年半
c1043ef50b 更新 bot.py
修改彩蛋权重喵~主打一个众生平等喵
2025-11-19 22:44:40 +08:00
雅诺狐
053bf81b25 Add weighted_choice utility and improve easter_egg randomness
Introduced a weighted_choice function for weighted random selection. Refactored the easter_egg function to use weighted_choice for more flexible and controlled message selection, replacing the previous randint-based logic.
2025-11-19 22:44:05 +08:00
ikun两年半
c2a8e9bd43 更新 bot.py
喵喵~修复了彩蛋概率问题喵~
2025-11-19 22:44:05 +08:00
minecraft1024a
46246d6f34 chore(deps): remove legacy gemini client and fix easter egg range 2025-11-19 22:44:04 +08:00
minecraft1024a
bd218db8e4 feat(彩蛋): 增加彩蛋文本的随机性
在 `easter_egg` 函数中引入了随机数生成逻辑。
现在有20%的概率显示猫娘文本,80%的概率显示一个原有的文本,增加了趣味性。
2025-11-19 22:44:04 +08:00
ikun-11451
be454303c5 喵喵~ 2025-11-19 22:44:03 +08:00
minecraft1024a
27c63380c2 refactor(core): 调整数据库初始化时机
将数据库的初始化、表结构创建和自动迁移逻辑从配置文件加载时移动到主程序 `raw_main` 函数中。

这一改动旨在解决循环导入问题,并确保数据库在所有配置和核心模块加载完毕后才进行初始化,提高了程序的启动鲁棒性和模块独立性。
2025-11-19 22:43:17 +08:00
SengokuCola
8053067af5 feat:优化关键词显示,优化表达方式配置和逻辑 2025-08-09 00:10:41 +08:00
墨梓柒
e240fb92ca fix: 更新模型配置和环境变量,调整版本号和模型参数 2025-07-27 13:37:21 +08:00
UnCLAS-Prommer
1aa2734d62 typing fix 2025-07-17 00:10:41 +08:00
墨梓柒
2229f98993 fix:修复LPMM学习问题 2025-07-16 19:58:19 +08:00
github-actions[bot]
9eeff628b8 🤖 自动格式化代码 [skip ci] 2025-07-08 18:10:43 +00:00
SengokuCola
50f0ddf2ce feat;新的情绪系统 2025-07-09 01:50:26 +08:00
github-actions[bot]
324b294b5f 🤖 自动格式化代码 [skip ci] 2025-07-01 11:33:16 +00:00
SengokuCola
3ef3923a8b Merge branch 'dev-s4u' into dev 2025-07-01 19:33:06 +08:00
SengokuCola
7b18ad17fc Merge branch 'dev-s4u' of https://github.com/MaiM-with-u/MaiBot into dev-s4u 2025-07-01 15:41:59 +08:00
Cookie987
2d2f6ecd8d 非TTY环境禁用console_input_loop 2025-07-01 12:50:10 +08:00
github-actions[bot]
284c248add 🤖 自动格式化代码 [skip ci] 2025-06-25 07:55:16 +00:00
SengokuCola
5351b7639c better:优化表达方式和侧面人格 2025-06-25 15:53:59 +08:00
github-actions[bot]
36e763ec89 🤖 自动格式化代码 [skip ci] 2025-06-24 14:35:49 +00:00
SengokuCola
8595268740 feat:不完善的控制台发送 2025-06-24 22:32:06 +08:00
SengokuCola
2b572b9abf feat:不完善的控制台发送 2025-06-24 22:17:59 +08:00
github-actions[bot]
a733020228 🤖 自动格式化代码 [skip ci] 2025-06-15 05:14:57 +00:00
SengokuCola
83ae078d6e fix:修复日志占用和文件层级 2025-06-15 13:14:39 +08:00
github-actions[bot]
86be17405a 🤖 自动格式化代码 [skip ci] 2025-06-14 17:28:38 +00:00
SengokuCola
327580dbec fix:ai哥神秘修复无法模式切换 2025-06-15 01:27:54 +08:00
SengokuCola
1a1a48508d fix:修复零散小问题 2025-06-14 11:41:41 +08:00
SengokuCola
247645f8b5 update logger 2025-06-12 23:56:58 +08:00
SengokuCola
91636b82ec fix:ruff 2025-06-12 20:32:18 +08:00
github-actions[bot]
9b4fa2155e 🤖 自动格式化代码 [skip ci] 2025-06-12 12:30:00 +00:00
SengokuCola
745d762dbb feat:可配置log,解决可读性问题 2025-06-12 20:13:47 +08:00
春河晴
6767bd6715 fix: 懒加载单例以修复环境变量加载问题 2025-06-11 17:22:43 +09:00
春河晴
61d6672b46 use logger.warning instead of logger.warn 2025-06-11 16:15:24 +09:00
春河晴
7b4e7b94f8 use structlog instead of loguru 2025-06-11 15:17:08 +09:00
Oct-autumn
46d15b1fe7 feat: 添加异步任务管理器和本地存储管理器,重构统计模块 2025-05-13 00:55:50 +08:00
github-actions[bot]
afbe4f280e 🤖 自动格式化代码 [skip ci] 2025-05-06 16:21:18 +00:00
墨梓柒
1e2cdeeea5 feat: 添加强制停止MAI Bot的API接口(半成品),优化嵌入数据目录路径处理 2025-05-07 00:21:04 +08:00
SengokuCola
15ec8394d7 fix:使用工作路径使mmc在启动器运行时读取文件无误 2025-05-06 14:14:54 +08:00
SengokuCola
49a34581c3 feat:新增flet启动器 2025-05-04 18:02:46 +08:00
墨梓柒
edda834538 fix: 移除Traceback函数中的 show_locals 参数以简化错误追踪 2025-05-02 12:01:05 +08:00
github-actions[bot]
c88a73597a 🤖 自动格式化代码 [skip ci] 2025-05-01 19:18:37 +00:00
墨梓柒
9cf62f983e feat:为多个模块添加丰富的追踪信息以增强调试能力 2025-05-02 03:18:24 +08:00
晴猫
45c64208b4 refactor: Clean up unused variables and improve code readability 2025-05-01 07:24:52 +09:00
晴猫
2f669c7055 QA: Update requirements and refactor message handling logic etc. 2025-05-01 05:58:18 +09:00
github-actions[bot]
412efe79d2 🤖 自动格式化代码 [skip ci] 2025-04-27 16:22:32 +00:00
墨梓柒
12b03ecb8d 重构跨多个模块的日志配置
- 将“get_module_logger”替换为新模块“logger_manager”中的“get_logger”,以实现一致的日志设置。
- 移除了单独的日志配置设置,转而采用集中式日志管理。
- 更新了多个文件中的日志初始化方法,包括“config.py”、“change_mood.py”、“change_relationship.py”等,以简化日志记录实践。
- 引入“logger_manager.py”,用于根据模块特定的样式处理日志配置。
2025-04-28 00:22:05 +08:00
墨梓柒
79260d3b86 refactor(logger): 统一日志配置并添加模块特定样式
为远程、表情、主程序、后台任务等模块添加了特定的日志样式配置,并统一了日志初始化方式,以提高日志的可读性和一致性。
2025-04-23 23:16:20 +08:00