Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,6 @@ import requests
|
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
from smolagents import Tool, CodeAgent, HfApiModel
|
| 8 |
-
#from smolagents.models import HfApiModel
|
| 9 |
|
| 10 |
from audio_transcriber import AudioTranscriptionTool
|
| 11 |
from image_analyzer import ImageAnalysisTool
|
|
@@ -34,13 +33,19 @@ Only return the exact answer."""
|
|
| 34 |
# Define agent tools
|
| 35 |
audio_tool = AudioTranscriptionTool()
|
| 36 |
image_tool = ImageAnalysisTool()
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
tools = [audio_tool, image_tool, wiki_tool]
|
| 46 |
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
from smolagents import Tool, CodeAgent, HfApiModel
|
|
|
|
| 8 |
|
| 9 |
from audio_transcriber import AudioTranscriptionTool
|
| 10 |
from image_analyzer import ImageAnalysisTool
|
|
|
|
| 33 |
# Define agent tools
|
| 34 |
audio_tool = AudioTranscriptionTool()
|
| 35 |
image_tool = ImageAnalysisTool()
|
| 36 |
+
|
| 37 |
+
class WikipediaTool(Tool):
|
| 38 |
+
name = "wikipedia_search"
|
| 39 |
+
description = "Search for facts using Wikipedia."
|
| 40 |
+
inputs = {
|
| 41 |
+
"query": {"type": "string", "description": "Search query"}
|
| 42 |
+
}
|
| 43 |
+
output_type = "string"
|
| 44 |
+
|
| 45 |
+
def forward(self, query: str) -> str:
|
| 46 |
+
return WikipediaSearcher().search(query)
|
| 47 |
+
|
| 48 |
+
wiki_tool = WikipediaTool()
|
| 49 |
|
| 50 |
tools = [audio_tool, image_tool, wiki_tool]
|
| 51 |
|