Spaces:
Build error
Build error
added youtube transcript tool
Browse filesFiles changed (2)
3 unmodified lines456789103 unmodified linesIf there is an Excel file attached (file name and file URL) use tool for getting content of the Excel file from URL.If there is an MP3 file attached (file name and file URL) use tool for getting content by transcribing text out of file URL.If there is an Python code file attached (file name and file URL) use tool for execution of Python code file URL and getting back output.If there is an Youtube video URL use tool for getting transcript text out of youtube URL.
Format of your answer - [ANSWER]. [ANSWER] can be a number, list of items divided by comma or a string. Be very concise and clear with the answer.Do not include any plans, thoughts and explanations into the answer. Just provide concise and unambiguous answer in the format above.201 unmodified lines202203204205206207208209210211212213214215216217218219220221222223224225226227228229230208231232233234235201 unmodified lines
return result.stdout
@tooldef get_youtube_video_transcript(youtube_video_url: str) -> str: """Get the transcript of a youtube video from URL"""
SEARCHAPI_API_KEY = os.getenv("SEARCHAPI_API_KEY")
# extract video id from url, https://www.youtube.com/watch?v=dQw4w9WgXcQ video_id = youtube_video_url.split("v=")[1]
# get the transcript of the video url = "https://www.searchapi.io/api/v1/search" params = { "engine": "youtube_transcripts", "video_id": video_id, "api_key": SEARCHAPI_API_KEY }
response = requests.get(url, params=params)
response_json = response.json()
return response_json["transcripts"]
def compile_agent():
tools = [multiply, divide, add, subtract, square_root, web_search_tool, arxiv_search, wikipedia_search, download_image_and_analyze, get_excel_file_content, transcribe_audio_mp3_file, execute_python_code] wikipedia_search, download_image_and_analyze, get_excel_file_content, transcribe_audio_mp3_file, execute_python_code, get_youtube_video_transcript]
# HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
system_prompt.txt+1
unit4agent.py+25-1