Update app.py
Browse files
app.py
CHANGED
@@ -19,12 +19,17 @@ search_tool = DuckDuckGoSearchTool()
|
|
19 |
class WikipediaTool(Tool):
|
20 |
name = "wikipedia_search"
|
21 |
description = "Search Wikipedia for a given topic and return a concise summary."
|
22 |
-
|
|
|
|
|
23 |
"query": {
|
24 |
"type": "string",
|
25 |
"description": "The topic to search on Wikipedia"
|
26 |
-
|
|
|
|
|
27 |
}
|
|
|
28 |
output_type = "string"
|
29 |
|
30 |
def forward(self, query: str) -> str:
|
@@ -43,12 +48,17 @@ class WikipediaTool(Tool):
|
|
43 |
class AudioTranscriptionTool(Tool):
|
44 |
name = "audio_transcriber"
|
45 |
description = "Transcribes an uploaded audio file to text using Whisper."
|
46 |
-
|
|
|
|
|
47 |
"audio": {
|
48 |
-
"type": "
|
49 |
-
"description": "The audio file to transcribe"
|
50 |
-
|
|
|
|
|
51 |
}
|
|
|
52 |
output_type = "string"
|
53 |
|
54 |
def forward(self, audio: bytes) -> str:
|
@@ -69,12 +79,17 @@ class AudioTranscriptionTool(Tool):
|
|
69 |
class ExcelReaderTool(Tool):
|
70 |
name = "excel_reader"
|
71 |
description = "Reads uploaded Excel file and summarizes sheet data."
|
72 |
-
|
|
|
|
|
73 |
"excel": {
|
74 |
-
"type": "
|
75 |
-
"description": "The Excel (.xlsx)
|
76 |
-
|
|
|
|
|
77 |
}
|
|
|
78 |
output_type = "string"
|
79 |
|
80 |
def forward(self, excel: bytes) -> str:
|
|
|
19 |
class WikipediaTool(Tool):
|
20 |
name = "wikipedia_search"
|
21 |
description = "Search Wikipedia for a given topic and return a concise summary."
|
22 |
+
parameters = {
|
23 |
+
"type": "object",
|
24 |
+
"properties": {
|
25 |
"query": {
|
26 |
"type": "string",
|
27 |
"description": "The topic to search on Wikipedia"
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"required": ["query"]
|
31 |
}
|
32 |
+
|
33 |
output_type = "string"
|
34 |
|
35 |
def forward(self, query: str) -> str:
|
|
|
48 |
class AudioTranscriptionTool(Tool):
|
49 |
name = "audio_transcriber"
|
50 |
description = "Transcribes an uploaded audio file to text using Whisper."
|
51 |
+
parameters = {
|
52 |
+
"type": "object",
|
53 |
+
"properties": {
|
54 |
"audio": {
|
55 |
+
"type": "string", # Must be base64-encoded string if passed to LLM
|
56 |
+
"description": "The audio file (base64-encoded) to transcribe"
|
57 |
+
}
|
58 |
+
},
|
59 |
+
"required": ["audio"]
|
60 |
}
|
61 |
+
|
62 |
output_type = "string"
|
63 |
|
64 |
def forward(self, audio: bytes) -> str:
|
|
|
79 |
class ExcelReaderTool(Tool):
|
80 |
name = "excel_reader"
|
81 |
description = "Reads uploaded Excel file and summarizes sheet data."
|
82 |
+
parameters = {
|
83 |
+
"type": "object",
|
84 |
+
"properties": {
|
85 |
"excel": {
|
86 |
+
"type": "string", # Same as above, assume base64 input
|
87 |
+
"description": "The Excel file (.xlsx, base64-encoded)"
|
88 |
+
}
|
89 |
+
},
|
90 |
+
"required": ["excel"]
|
91 |
}
|
92 |
+
|
93 |
output_type = "string"
|
94 |
|
95 |
def forward(self, excel: bytes) -> str:
|