Commit Graph

191 Commits

Author SHA1 Message Date
雅诺狐
1b9c86abef Refactor web search plugin and clean up code
Refactored the web search plugin by removing the old Bing search implementation and reorganizing the plugin structure. Introduced modular search engine classes under 'web_search_tool/engines' and utility tools under 'web_search_tool/tools' and 'web_search_tool/utils'. Updated references and initialization logic to support multiple search engines and improved maintainability. Also performed minor code cleanups and replaced 'except ...: pass' with 'except ...: ...' for brevity.
2025-11-19 22:45:42 +08:00
雅诺狐
90f5e2357e Improve anti-injector status handling and statistics
Moved statistics update to only occur when the anti-injector system is enabled. Enhanced statistics reporting to handle disabled state and improved uptime calculation to use session start time. Updated status command to provide clearer feedback when the anti-injector system is disabled or when errors occur. Also fixed a docstring in prompt_builder.py for clarity.
2025-11-19 22:45:03 +08:00
minecraft1024a
a31ee1ab5f refactor(video): update config key from utils_video to video_analysis 2025-11-19 22:44:56 +08:00
minecraft1024a
7d13d0b6c2 fix(embedding): 彻底解决事件循环冲突导致的嵌入生成异常
通过以下改动修复嵌入生成过程中的事件循环相关问题:
- 在 EmbeddingStore._get_embedding 中,改为同步创建-使用-销毁的新事件循环模式,彻底避免嵌套事件循环问题
- 调整批量嵌入 _get_embeddings_batch_threaded,确保每个线程使用独立、短生命周期的事件循环
- 新增 force_new 参数,LLM 请求嵌入任务时强制创建新的客户端实例,减少跨循环对象复用
- 在 OpenAI 客户端的 embedding 调用处补充详细日志,方便排查网络连接异常
- get_embedding() 每次都重建 LLMRequest,降低实例在多个事件循环中穿梭的概率

此次改动虽然以同步风格“硬掰”异步接口,但对现有接口零破坏,确保了向量数据库及相关知识检索功能的稳定性。(还有就是把的脚本文件夹移回来了)
2025-11-19 22:44:54 +08:00
雅诺狐
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
雅诺狐
383f704b53 Remove unused imports across multiple modules
Cleaned up various files by removing unused or redundant import statements to improve code readability and reduce potential confusion. No functional changes were made.
2025-11-19 22:44:32 +08:00
minecraft1024a
793c6e3817 fix(statistic): 修复统计任务中因数据库记录格式问题导致的异常
在处理来自数据库的记录时,增加对记录类型的检查和时间戳格式的转换。确保即使记录不是预期的字典格式,或者时间戳字段为None或字符串格式,程序也能够安全处理,避免因`TypeError`或`AttributeError`导致整个统计任务中断(说真的这都一天了为什么还没人修)
2025-11-19 22:42:24 +08:00
雅诺狐
875e02d42f 数据库重构 2025-11-19 22:40:23 +08:00
雅诺狐
dfecccfc56 llm统计记录模型反应时间 2025-11-19 22:40:11 +08:00
minecraft1024a
fe43cb3816 将聊天消息构建器中的日志级别从info调整为debug,以减少日志输出的冗余,优化调试信息的记录。 2025-11-19 22:39:16 +08:00
minecraft1024a
80eab4cf1a 在聊天消息构建器中添加日志记录功能,记录函数调用参数和处理过程,优化动作记录的返回格式,确保返回的动作记录包含必要字段。 2025-11-19 22:39:09 +08:00
ikun-11451
0053daffd9 给这个文件的请求session加上一个with上下文管理喵~ 2025-11-19 22:37:46 +08:00
minecraft1024a
1e785a117d 优化图片格式处理,统一将'jpg'格式转换为'jpeg',新增标准化和MIME类型转换功能,以确保API兼容性和提高代码可读性(最主要的还是为了gemini) 2025-11-19 22:36:09 +08:00
雅诺狐
2e6ae2419b 优化项目结构,格式化代码 2025-11-19 22:35:40 +08:00
雅诺狐
23ee3767ef 初始化 2025-11-19 22:34:56 +08:00
SengokuCola
fed0c0fd04 feat:更新记忆系统 2025-08-13 23:17:28 +08:00
SengokuCola
ca69e9af15 fix:修复注册顺序问题
Update person_info.py

Update relationship_manager.py
2025-08-12 15:42:59 +08:00
SengokuCola
ae254de494 better:重构personinfo,使用Person类和类属性 2025-08-12 14:33:13 +08:00
SengokuCola
268b428e8f feat: llm统计现已记录模型反应时间 2025-08-11 21:51:59 +08:00
UnCLAS-Prommer
43190b12d2 防炸 2025-08-11 11:29:05 +08:00
SengokuCola
1515cef487 fix:必要性修复 2025-08-11 01:08:42 +08:00
SengokuCola
3804124df8 fix:优化reply,填补缺失值,youhualog 2025-08-11 00:19:31 +08:00
SengokuCola
b57671b639 fix:修复表情包描述进入prompt问题 2025-08-09 21:16:57 +08:00
Windpicker-owo
b79faf8f86 修复了语音识别一个不太聪明的bug 2025-08-01 15:30:35 +08:00
UnCLAS-Prommer
75689d760d ruff 2025-08-01 14:33:24 +08:00
Windpicker-owo
25cb8d41bb 修复了语音识别功能 2025-08-01 03:32:00 +08:00
UnCLAS-Prommer
37e52a1566 tools系统 2025-07-31 11:41:15 +08:00
UnCLAS-Prommer
6c0edd0ad7 调整对应的调用 2025-07-30 17:07:55 +08:00
SengokuCola
7b5520a667 Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev 2025-07-25 21:29:47 +08:00
SengokuCola
29e1d6efae feat:修复emoji和图片的缓存
Update send_api.py
2025-07-25 21:03:27 +08:00
UnCLAS-Prommer
29229d9a36 typing fix 2025-07-25 19:56:01 +08:00
SengokuCola
6900a8b269 feat:优化关键词提取,优化at和回复的解析 2025-07-25 16:51:13 +08:00
SengokuCola
4ab6d59a79 fix:修复enable_thinking导致的400问题 2025-07-24 23:20:05 +08:00
SengokuCola
db896299be fix:修复问题 2025-07-24 22:30:27 +08:00
UnCLAS-Prommer
74fabd556d 修复配置文件变动产生的错误 2025-07-24 09:33:58 +08:00
SengokuCola
a02ea61386 fix ruff 2025-07-24 05:00:30 +08:00
SengokuCola
6c91b95314 better:新增log前缀映射,优化emoji的显示,加强了emoji的识别 2025-07-24 04:54:47 +08:00
SengokuCola
b4a92ee5d5 feat:为表达添加创建时间 2025-07-24 00:36:53 +08:00
SengokuCola
398e15232e feat:升级loger_viewer,移除无用脚本 2025-07-23 23:55:15 +08:00
UnCLAS-Prommer
76025032a9 增加了卸载和重载插件功能 2025-07-22 18:52:11 +08:00
UnCLAS-Prommer
f2c901bc98 typing 2025-07-20 18:14:53 +08:00
Windpicker-owo
3d9f1a1d5a 增加了enable_asr配置选项,更改一处潜在的bug 2025-07-18 13:02:38 +08:00
Windpicker-owo
830acaf35f 优化了代码规范 2025-07-17 15:35:13 +08:00
Windpicker-owo
367be4e7d7 优化了部分代码 2025-07-17 15:12:20 +08:00
Windpicker-owo
587aca4d18 增加对voice类型消息的支持 2025-07-17 14:50:19 +08:00
UnCLAS-Prommer
1aa2734d62 typing fix 2025-07-17 00:10:41 +08:00
SengokuCola
4aff3c8005 feat:测试性的新辅助记忆系统 2025-07-16 16:11:56 +08:00
墨梓柒
3a1f544014 soft reset commit c71f2b21c064564631b960ecbbca6f25cfcae08d(use repush) 2025-07-16 11:20:26 +08:00
墨梓柒
c71f2b21c0 feat: 添加同步获取embedding向量和生成响应的方法 2025-07-16 11:00:16 +08:00
SengokuCola
d67cffd953 fix ruff 2025-07-16 00:22:07 +08:00