Update app.py
Browse files
app.py
CHANGED
@@ -36,9 +36,9 @@ class WikipediaTool(Tool):
|
|
36 |
return "No Wikipedia page found."
|
37 |
except Exception as e:
|
38 |
return f"Error: {str(e)}"
|
|
|
39 |
|
40 |
-
|
41 |
-
# --- Tool 2: Audio Transcription Tool (uses whisper base) ---
|
42 |
class AudioTranscriptionTool(Tool):
|
43 |
name = "audio_transcriber"
|
44 |
description = "Transcribes an uploaded audio file to text using Whisper."
|
@@ -62,7 +62,7 @@ class AudioTranscriptionTool(Tool):
|
|
62 |
return result["text"]
|
63 |
except Exception as e:
|
64 |
return f"Transcription failed: {str(e)}"
|
65 |
-
|
66 |
|
67 |
# --- Tool 3: Excel Reader Tool ---
|
68 |
class ExcelReaderTool(Tool):
|
@@ -89,14 +89,14 @@ class ExcelReaderTool(Tool):
|
|
89 |
return f"Summary statistics:\n{summary}"
|
90 |
except Exception as e:
|
91 |
return f"Failed to read Excel file: {str(e)}"
|
92 |
-
|
93 |
|
94 |
async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
95 |
log_output = ""
|
96 |
|
97 |
try:
|
98 |
agent = ToolCallingAgent(
|
99 |
-
tools=[search_tool,
|
100 |
model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
|
101 |
max_steps=15,
|
102 |
verbosity_level=0,
|
|
|
36 |
return "No Wikipedia page found."
|
37 |
except Exception as e:
|
38 |
return f"Error: {str(e)}"
|
39 |
+
wiki_tool = WikipediaTool()
|
40 |
|
41 |
+
# --- Tool 3: Audio Transcription Tool (uses whisper base) ---
|
|
|
42 |
class AudioTranscriptionTool(Tool):
|
43 |
name = "audio_transcriber"
|
44 |
description = "Transcribes an uploaded audio file to text using Whisper."
|
|
|
62 |
return result["text"]
|
63 |
except Exception as e:
|
64 |
return f"Transcription failed: {str(e)}"
|
65 |
+
audio_tool = AudioTranscriptionTool()
|
66 |
|
67 |
# --- Tool 3: Excel Reader Tool ---
|
68 |
class ExcelReaderTool(Tool):
|
|
|
89 |
return f"Summary statistics:\n{summary}"
|
90 |
except Exception as e:
|
91 |
return f"Failed to read Excel file: {str(e)}"
|
92 |
+
excel_tool = ExcelReaderTool()
|
93 |
|
94 |
async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
95 |
log_output = ""
|
96 |
|
97 |
try:
|
98 |
agent = ToolCallingAgent(
|
99 |
+
tools=[search_tool, wiki_tool, audio_tool, excel_tool],
|
100 |
model=InferenceClientModel(model="deepseek-ai/DeepSeek-V3", provider="together"),
|
101 |
max_steps=15,
|
102 |
verbosity_level=0,
|