rename func and enum variable

This commit is contained in:
getsomerest/sleepwell
2025-07-14 22:59:38 +08:00
committed by GitHub
parent 17f08dea67
commit 8384591869
2 changed files with 3 additions and 3 deletions

View File

@@ -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:

View File

@@ -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)