From 8384591869f9aa4d7e12451180debe2de4e1805d Mon Sep 17 00:00:00 2001 From: getsomerest/sleepwell <2268104085@qq.com> Date: Mon, 14 Jul 2025 22:59:38 +0800 Subject: [PATCH] rename func and enum variable --- agentuniverse/agent/action/tool/common_tool/youtube_tool.py | 4 ++-- .../unit/agent/action/tool/test_youtube_tool.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agentuniverse/agent/action/tool/common_tool/youtube_tool.py b/agentuniverse/agent/action/tool/common_tool/youtube_tool.py index 6606f5e8..e220c14b 100644 --- a/agentuniverse/agent/action/tool/common_tool/youtube_tool.py +++ b/agentuniverse/agent/action/tool/common_tool/youtube_tool.py @@ -85,7 +85,7 @@ class YouTubeTool(Tool): return [{"error": error_msg}] @retry(3, 1.0) - def _analyze_channel(self, channel_id: str) -> Dict: + def _get_channel_info(self, channel_id: str) -> Dict: try: response = self.service.channels().list( id=channel_id, @@ -183,7 +183,7 @@ class YouTubeTool(Tool): elif mode == Mode.CHANNEL_INFO.value: if input is None: raise ValueError("Channel ID is required for channel info mode.") - return self._analyze_channel(input) + return self._get_channel_info(input) elif mode == Mode.TRENDING_VIDEOS.value: return self._get_trending_videos(input) else: diff --git a/tests/test_agentuniverse/unit/agent/action/tool/test_youtube_tool.py b/tests/test_agentuniverse/unit/agent/action/tool/test_youtube_tool.py index 5b6008bb..042428f3 100644 --- a/tests/test_agentuniverse/unit/agent/action/tool/test_youtube_tool.py +++ b/tests/test_agentuniverse/unit/agent/action/tool/test_youtube_tool.py @@ -28,7 +28,7 @@ class YouTubeToolTest(unittest.TestCase): def test_analyze_channel(self) -> None: tool_input = ToolInput({ - 'mode': Mode.CHANNEL_ANALYZE.value, + 'mode': Mode.CHANNEL_INFO.value, 'input': 'UC_x5XG1OV2P6uZZ5FSM9Ttw' }) result = self.tool.execute(tool_input.mode, tool_input.input)