Commit Graph

18 Commits

Author SHA1 Message Date
minecraft1024a
98212bb938 feat(chat): 在聊天消息中显示用户 QQ 号 2025-09-24 20:22:45 +08:00
tt-P607
a32759687b feat(chat): 增加已读标记以聚焦未读消息
为聊天上下文生成逻辑引入了“已读标记” (read_mark) 机制。

当生成回复时,可以在历史消息中插入一个明确的分隔符,以告知模型哪些消息是它已经看过的旧消息,哪些是需要关注的新消息。

这有助于模型更好地聚焦于未读内容,提升上下文感知能力和回复的相关性。

同时,将 Prompt 模板中的“群聊”等硬编码文本参数化,以更好地适配私聊等不同聊天场景。
2025-09-23 15:24:28 +08:00
minecraft1024a
50f8273053 Merge branch 'dev' of https://github.com/MoFox-Studio/MoFox_Bot into dev 2025-09-20 22:21:43 +08:00
minecraft1024a
a9a9f380d6 refactor(person_info): 引入同步方法 get_value 并替换旧的 get_value_sync(因为根本就没有这个方法)
为了解决在不同异步上下文中同步调用数据库可能引发的运行时错误,实现了一个新的、更健壮的同步方法 `PersonInfoManager.get_value`。

- 新方法能够正确处理已在运行的 asyncio 事件循环,提高了在混合代码环境中调用的稳定性。
- 全面替换了原有的 `get_value_sync` 方法调用,统一了同步获取用户信息的接口。
2025-09-20 22:21:35 +08:00
tt-P607
ca780919a8 fix(core): 修正因异步改造遗漏的 await 调用
在最近的数据库异步化重构后,部分函数的调用处忘记添加 `await` 关键字,导致协程未被正确执行。

本次提交修复了以下模块中的问题:
- `ExpressionLearner`
- `ChatMessageBuilder`
- `EmojiAction
2025-09-20 22:04:43 +08:00
tt-P607
0cc4f5bb27 三次修改 2025-09-20 02:21:53 +08:00
minecraft1024a
2db6be9b5b fix(chat): 修复计划过滤器和消息构建器中的潜在空指针问题
- 在 `plan_filter.py` 中,当LLM未指定 `target_message_id` 时,明确将目标消息设置为最新的消息,避免后续操作因 `target_message_dict` 未定义而出错。
- 在 `chat_message_builder.py` 中,为 `replace_user_references_sync` 函数增加了对 `content` 为空的检查,防止后续处理引发异常。
- 将数据库查询从 `.scalar()` 改为 `.scalar_one_or_none()`,以更清晰地处理未找到结果的情况。
2025-09-13 14:46:50 +08:00
minecraft1024a
513757a8ee chore: format code and remove redundant blank lines
This commit applies automated code formatting across the project. The changes primarily involve removing unnecessary blank lines and ensuring consistent code style, improving readability and maintainability without altering functionality.
2025-09-05 20:58:03 +08:00
Windpicker-owo
a63ca537d1 fix:修复图片识别爆炸 2025-09-03 20:03:47 +08:00
Windpicker-owo
9f49a453da 迁移:3804124,9e9e796
(feat:将no_reply内置、fix:优化reply,填补缺失值)
2025-09-01 21:12:55 +08:00
Windpicker-owo
8149731925 修复代码格式和文件名大小写问题 2025-08-31 20:50:17 +08:00
雅诺狐
f8ba0d0e43 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-08-21 23:42:16 +08:00
雅诺狐
5e91f9ef5f 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-08-19 11:55:24 +08:00
雅诺狐
d46d689c43 数据库重构 2025-08-16 23:43:45 +08:00
minecraft1024a
9b49c20614 将聊天消息构建器中的日志级别从info调整为debug,以减少日志输出的冗余,优化调试信息的记录。 2025-08-14 15:33:42 +08:00
minecraft1024a
ec63259886 在聊天消息构建器中添加日志记录功能,记录函数调用参数和处理过程,优化动作记录的返回格式,确保返回的动作记录包含必要字段。 2025-08-14 14:07:42 +08:00
ikun-11451
6f54da9e2d 给这个文件的请求session加上一个with上下文管理喵~ 2025-08-13 19:09:24 +08:00
雅诺狐
2d4745cd58 初始化 2025-08-11 19:34:18 +08:00