refactor(cross_context): 重构互通组上下文获取逻辑

重构并简化了互通组上下文的获取函数 `get_intercom_group_context`。旧的 `get_chat_history_by_group_name` 和 `get_intercom_group_context_by_name` 函数被合并和优化。

主要变更:
- 移除了冗余的 `get_chat_history_by_group_name` 函数。
- 将 `get_intercom_group_context_by_name` 重命名为 `get_intercom_group_context`,并简化了其参数。
- 增加了对黑名单模式的支持,现在可以正确地从所有聊天中排除指定会话。
- 优化了消息获取和格式化流程,现在按聊天会话分块返回消息,而不是将所有消息混合在一起排序,提高了上下文的可读性。
- 清理了代码格式和移除了未使用的导入。
This commit is contained in:
minecraft1024a
2025-10-11 20:56:15 +08:00
committed by Windpicker-owo
parent cca07bd16e
commit 892e106015
2 changed files with 78 additions and 113 deletions

View File

@@ -190,7 +190,7 @@ class QZoneService:
获取互通组的聊天上下文。
"""
# 实际的逻辑已迁移到 cross_context_api
return await cross_context_api.get_intercom_group_context_by_name("maizone_context_group")
return await cross_context_api.get_intercom_group_context("maizone_context_group")
async def _reply_to_own_feed_comments(self, feed: dict, api_client: dict):
"""处理对自己说说的评论并进行回复"""