Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,13 +12,7 @@ from smolagents.models import OpenAIServerModel
|
|
| 12 |
from smolagents import Tool
|
| 13 |
from wikipedia_searcher import WikipediaSearcher
|
| 14 |
|
| 15 |
-
|
| 16 |
-
# name="wikipedia_search",
|
| 17 |
-
# func=WikipediaSearcher().search,
|
| 18 |
-
# description="Search Wikipedia for a given query.",
|
| 19 |
-
# inputs={"query": "string"},
|
| 20 |
-
# output_type="string"
|
| 21 |
-
#)
|
| 22 |
|
| 23 |
|
| 24 |
class WikipediaSearchTool(Tool):
|
|
@@ -42,6 +36,7 @@ class WikipediaSearchTool(Tool):
|
|
| 42 |
wikipedia_search_tool = WikipediaSearchTool()
|
| 43 |
|
| 44 |
|
|
|
|
| 45 |
# Define the system prompt
|
| 46 |
SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question.
|
| 47 |
Report your thoughts, and finish your answer with the following template:
|
|
@@ -66,11 +61,8 @@ class MyAgent:
|
|
| 66 |
self.model = PatchedOpenAIServerModel(model_id="gpt-4-turbo")
|
| 67 |
self.agent = CodeAgent(tools=[
|
| 68 |
DuckDuckGoSearchTool(),
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
#WikipediaSearchTool(),
|
| 72 |
-
#WikipediaTool()
|
| 73 |
-
wikipedia_search_tool
|
| 74 |
], model=self.model)
|
| 75 |
|
| 76 |
def __call__(self, task: dict) -> str:
|
|
|
|
| 12 |
from smolagents import Tool
|
| 13 |
from wikipedia_searcher import WikipediaSearcher
|
| 14 |
|
| 15 |
+
from tools.audio_transcriber import AudioTranscriptionTool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
class WikipediaSearchTool(Tool):
|
|
|
|
| 36 |
wikipedia_search_tool = WikipediaSearchTool()
|
| 37 |
|
| 38 |
|
| 39 |
+
|
| 40 |
# Define the system prompt
|
| 41 |
SYSTEM_PROMPT = """You are a general AI assistant. I will ask you a question.
|
| 42 |
Report your thoughts, and finish your answer with the following template:
|
|
|
|
| 61 |
self.model = PatchedOpenAIServerModel(model_id="gpt-4-turbo")
|
| 62 |
self.agent = CodeAgent(tools=[
|
| 63 |
DuckDuckGoSearchTool(),
|
| 64 |
+
wikipedia_search_tool,
|
| 65 |
+
AudioTranscriptionTool()
|
|
|
|
|
|
|
|
|
|
| 66 |
], model=self.model)
|
| 67 |
|
| 68 |
def __call__(self, task: dict) -> str:
|