flashdata-dev's picture
Clarify capability names and simplify documentation
a6e0409 verified
Raw History Blame Contribute Delete
1.07 kB
from smolagents import Tool
class FlashDataTool(Tool):
name = 'youtube_channel'
description = 'Get a YouTube channel profile and recent videos from its handle. Retrieve channel details and a bounded list of recent uploads. Request 1–100 recent videos. This is not a complete channel archive; statistics and other fields may be unavailable. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
inputs = {'handle': {'description': 'YouTube channel handle, for example @jawed.', 'type': 'string'},
'video_limit': {'description': 'Video limit. minimum: 1. maximum: 100. Default: 20.',
'nullable': True,
'type': 'integer'}}
output_type = 'object'
def forward(self, handle: str, video_limit: int = 20) -> dict:
from langchain_flashdata import FlashDataYouTubeChannel
values = {'handle': handle, 'video_limit': video_limit}
return FlashDataYouTubeChannel().invoke({key: value for key, value in values.items() if value is not None})