Commit 82e76fce by sunqi02 Committed by 胡悦

refactor(hooks): remove account_mapping from PostReplyHook

bot_id now sourced exclusively from per-request bot_id_mapping
1 parent d31d6c46
......@@ -15,14 +15,9 @@ class IMSender(Protocol):
class PostReplyHook(Hook):
"""Hook triggered after agent generates a reply, sends it via IM"""
def __init__(
self,
im_service: IMSender,
account_mapping: Dict[str, str]
):
def __init__(self, im_service: IMSender):
super().__init__("post_reply")
self.im_service = im_service
self.account_mapping = account_mapping
async def execute(
self,
......@@ -38,8 +33,7 @@ class PostReplyHook(Hook):
if not agent_name or not response_content:
return None
# bot_id 优先从请求映射中取,兜底用静态配置
bot_id = bot_id_mapping.get(agent_name) or self.account_mapping.get(agent_name)
bot_id = bot_id_mapping.get(agent_name)
if not bot_id:
return None
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!