mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
rename func and enum variable
This commit is contained in:
committed by
GitHub
parent
17f08dea67
commit
8384591869
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user