Spaces:
Sleeping
Sleeping
Create agent_tools.py
Browse files- agent_tools.py +25 -0
agent_tools.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from smolagents import Tool, DuckDuckGoSearchTool, GoogleSearchTool, VisitWebpageTool, WikipediaSearchTool, PythonInterpreterTool, FinalAnswerTool
|
2 |
+
from tavily import TavilyClient
|
3 |
+
from dotenv import load_dotenv
|
4 |
+
import os
|
5 |
+
|
6 |
+
load_dotenv()
|
7 |
+
|
8 |
+
# Inicialización de herramientas
|
9 |
+
duck_search = DuckDuckGoSearchTool()
|
10 |
+
google_search = GoogleSearchTool()
|
11 |
+
visit_page = VisitWebpageTool()
|
12 |
+
wiki_search = WikipediaSearchTool()
|
13 |
+
do_python = PythonInterpreterTool()
|
14 |
+
final_answer = FinalAnswerTool()
|
15 |
+
tavily_search = TavilyClient()
|
16 |
+
|
17 |
+
speech_to_text_tool = Tool.from_space("hf-audio/whisper-large-v3-turbo",
|
18 |
+
name="speech_to_text_tool",
|
19 |
+
description="Convierte audio a texto a partir de un archivo o URL.",
|
20 |
+
api_name="/predict")
|
21 |
+
|
22 |
+
visual_qa_tool = Tool.from_space("sitammeur/PicQ",
|
23 |
+
name="visual_qa_tool",
|
24 |
+
description="Responde preguntas sobre una imagen proporcionada.",
|
25 |
+
api_name="/predict")
|