Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -10,7 +10,8 @@ from PIL import Image, ImageOps
|
|
| 10 |
import requests
|
| 11 |
from io import BytesIO
|
| 12 |
from markdownify import markdownify
|
| 13 |
-
import
|
|
|
|
| 14 |
import time
|
| 15 |
import shutil
|
| 16 |
import traceback
|
|
@@ -156,7 +157,7 @@ class ExcelReaderTool(Tool):
|
|
| 156 |
"nullable": True
|
| 157 |
}
|
| 158 |
}
|
| 159 |
-
output_type = "
|
| 160 |
|
| 161 |
def forward(self, excel_path: str, sheet_name: str = None) -> str:
|
| 162 |
try:
|
|
@@ -256,6 +257,8 @@ class MagAgent:
|
|
| 256 |
- Reason step-by-step. Think through the solution logically and plan your actions carefully before answering.
|
| 257 |
- Validate information. Always verify facts when possible instead of guessing.
|
| 258 |
- When processing external data (e.g., YouTube transcripts, web searches), expect potential issues like missing punctuation, inconsistent formatting, or conversational text.
|
|
|
|
|
|
|
| 259 |
- When asked to transcript YouTube video, try searching it in www.youtubetotranscript.com.
|
| 260 |
- If the input is ambiguous, prioritize extracting key information relevant to the question.
|
| 261 |
- Use code if needed. For calculations, parsing, or transformations, generate Python code and execute it. Be cautious, as some questions contain time-consuming tasks, so analyze the question and choose the most efficient solution.
|
|
|
|
| 10 |
import requests
|
| 11 |
from io import BytesIO
|
| 12 |
from markdownify import markdownify
|
| 13 |
+
import
|
| 14 |
+
whisper
|
| 15 |
import time
|
| 16 |
import shutil
|
| 17 |
import traceback
|
|
|
|
| 157 |
"nullable": True
|
| 158 |
}
|
| 159 |
}
|
| 160 |
+
output_type = "pandas.DataFrame"
|
| 161 |
|
| 162 |
def forward(self, excel_path: str, sheet_name: str = None) -> str:
|
| 163 |
try:
|
|
|
|
| 257 |
- Reason step-by-step. Think through the solution logically and plan your actions carefully before answering.
|
| 258 |
- Validate information. Always verify facts when possible instead of guessing.
|
| 259 |
- When processing external data (e.g., YouTube transcripts, web searches), expect potential issues like missing punctuation, inconsistent formatting, or conversational text.
|
| 260 |
+
- When asked to process Excel files, use the `excel_reader` tool, which returns a pandas DataFrame.
|
| 261 |
+
- When calculating sales, make sure you multiply volume on price per each product or category.
|
| 262 |
- When asked to transcript YouTube video, try searching it in www.youtubetotranscript.com.
|
| 263 |
- If the input is ambiguous, prioritize extracting key information relevant to the question.
|
| 264 |
- Use code if needed. For calculations, parsing, or transformations, generate Python code and execute it. Be cautious, as some questions contain time-consuming tasks, so analyze the question and choose the most efficient solution.
|