From fabd223253b99ca21d70ee4245a76fc285dd6ba7 Mon Sep 17 00:00:00 2001 From: Sun Tao <2605127667@qq.com> Date: Fri, 12 Sep 2025 14:15:18 +0800 Subject: [PATCH 1/3] Update slack_toolkit.py --- backend/app/utils/toolkit/slack_toolkit.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/app/utils/toolkit/slack_toolkit.py b/backend/app/utils/toolkit/slack_toolkit.py index 89987b1ff..dac33d357 100644 --- a/backend/app/utils/toolkit/slack_toolkit.py +++ b/backend/app/utils/toolkit/slack_toolkit.py @@ -51,13 +51,10 @@ class SlackToolkit(BaseSlackToolkit, AbstractToolkit): @listen_toolkit( BaseSlackToolkit.send_slack_message, - lambda _, - message, - channel_id, - user=None: f"send Slack message: {message} to channel id: {channel_id} for user: {user}", + lambda _, message, channel_id, file_path, user: f"send Slack message: {message} to channel id: {channel_id}, file: {file_path}, user: {user}", ) - def send_slack_message(self, message: str, channel_id: str, user: str | None = None) -> str: - return super().send_slack_message(message, channel_id, user) + def send_slack_message(self, message: str, channel_id: str, file_path: str, user: str) -> str: + return super().send_slack_message(message, channel_id, file_path, user) @listen_toolkit( BaseSlackToolkit.delete_slack_message, From a1e38898594e929255de41461ff654b246945d0b Mon Sep 17 00:00:00 2001 From: Sun Tao <2605127667@qq.com> Date: Fri, 12 Sep 2025 14:21:42 +0800 Subject: [PATCH 2/3] Update slack_toolkit.py --- backend/app/utils/toolkit/slack_toolkit.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/backend/app/utils/toolkit/slack_toolkit.py b/backend/app/utils/toolkit/slack_toolkit.py index dac33d357..3c681ed89 100644 --- a/backend/app/utils/toolkit/slack_toolkit.py +++ b/backend/app/utils/toolkit/slack_toolkit.py @@ -51,9 +51,9 @@ class SlackToolkit(BaseSlackToolkit, AbstractToolkit): @listen_toolkit( BaseSlackToolkit.send_slack_message, - lambda _, message, channel_id, file_path, user: f"send Slack message: {message} to channel id: {channel_id}, file: {file_path}, user: {user}", + lambda _, message, channel_id, file_path=None, user=None: f"send Slack message: {message} to channel id: {channel_id}, file: {file_path}, user: {user}", ) - def send_slack_message(self, message: str, channel_id: str, file_path: str, user: str) -> str: + def send_slack_message(self, message: str, channel_id: str, file_path: str | None = None, user: str | None = None) -> str: return super().send_slack_message(message, channel_id, file_path, user) @listen_toolkit( @@ -64,6 +64,20 @@ class SlackToolkit(BaseSlackToolkit, AbstractToolkit): ) def delete_slack_message(self, time_stamp: str, channel_id: str) -> str: return super().delete_slack_message(time_stamp, channel_id) + + @listen_toolkit( + BaseSlackToolkit.get_slack_user_list, + lambda _: "get Slack user list", + ) + def get_slack_user_list(self) -> list[dict]: + return super().get_slack_user_list() + + @listen_toolkit( + BaseSlackToolkit.get_slack_user_info, + lambda _, user_id: f"get Slack user info with user id: {user_id}", + ) + def get_slack_user_info(self, user_id: str) -> dict: + return super().get_slack_user_info(user_id) @classmethod def get_can_use_tools(cls, api_task_id: str) -> list[FunctionTool]: From be3b6a7377d9b25f728f6a3156508a125b1c31c1 Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Tue, 16 Sep 2025 16:03:29 +0800 Subject: [PATCH 3/3] enhance: PR 337 Slack enhance support file_path --- backend/app/utils/toolkit/slack_toolkit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/utils/toolkit/slack_toolkit.py b/backend/app/utils/toolkit/slack_toolkit.py index 3c681ed89..920047a5f 100644 --- a/backend/app/utils/toolkit/slack_toolkit.py +++ b/backend/app/utils/toolkit/slack_toolkit.py @@ -64,19 +64,19 @@ class SlackToolkit(BaseSlackToolkit, AbstractToolkit): ) def delete_slack_message(self, time_stamp: str, channel_id: str) -> str: return super().delete_slack_message(time_stamp, channel_id) - + @listen_toolkit( BaseSlackToolkit.get_slack_user_list, lambda _: "get Slack user list", ) - def get_slack_user_list(self) -> list[dict]: + def get_slack_user_list(self) -> str: return super().get_slack_user_list() @listen_toolkit( BaseSlackToolkit.get_slack_user_info, lambda _, user_id: f"get Slack user info with user id: {user_id}", ) - def get_slack_user_info(self, user_id: str) -> dict: + def get_slack_user_info(self, user_id: str) -> str: return super().get_slack_user_info(user_id) @classmethod