Spaces:
Runtime error
Runtime error
Create tool.py
Browse files
tool.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import List
|
| 2 |
+
from smolagents import (
|
| 3 |
+
DuckDuckGoSearchTool,
|
| 4 |
+
PythonInterpreterTool,
|
| 5 |
+
Tool,
|
| 6 |
+
VisitWebpageTool,
|
| 7 |
+
WikipediaSearchTool,
|
| 8 |
+
FinalAnswerTool,
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
from tools.tools import (
|
| 12 |
+
vision_tool,
|
| 13 |
+
youtube_frames_to_images,
|
| 14 |
+
ask_youtube_video,
|
| 15 |
+
read_text_file,
|
| 16 |
+
file_from_url,
|
| 17 |
+
transcribe_youtube,
|
| 18 |
+
audio_to_text,
|
| 19 |
+
extract_text_via_ocr,
|
| 20 |
+
summarize_csv_data,
|
| 21 |
+
summarize_excel_data,
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
def get_tools() -> List[Tool]:
|
| 25 |
+
"""
|
| 26 |
+
Returns a list of available tools for the agent.
|
| 27 |
+
Returns:
|
| 28 |
+
List[Tool]: List of initialized tool instances.
|
| 29 |
+
"""
|
| 30 |
+
tools = [
|
| 31 |
+
FinalAnswerTool(),
|
| 32 |
+
DuckDuckGoSearchTool(),
|
| 33 |
+
PythonInterpreterTool(),
|
| 34 |
+
WikipediaSearchTool(),
|
| 35 |
+
VisitWebpageTool(),
|
| 36 |
+
vision_tool,
|
| 37 |
+
youtube_frames_to_images,
|
| 38 |
+
ask_youtube_video,
|
| 39 |
+
read_text_file,
|
| 40 |
+
file_from_url,
|
| 41 |
+
transcribe_youtube,
|
| 42 |
+
audio_to_text,
|
| 43 |
+
extract_text_via_ocr,
|
| 44 |
+
summarize_csv_data,
|
| 45 |
+
summarize_excel_data,
|
| 46 |
+
]
|
| 47 |
+
return tools
|