Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -10,7 +10,7 @@ def web_search(query: str) -> str:
|
|
| 10 |
Returns:
|
| 11 |
The search results.
|
| 12 |
"""
|
| 13 |
-
print(f"Reached: web_search")
|
| 14 |
ddg = DuckDuckGoSearchRun()
|
| 15 |
return ddg.run(query)
|
| 16 |
|
|
@@ -26,7 +26,7 @@ def parse_excel(path: str, sheet_name: str = None) -> str:
|
|
| 26 |
"[{'Name': 'Alice', 'Score': 95}, {'Name': 'Bob', 'Score': 88}, ...]"
|
| 27 |
"""
|
| 28 |
# 1. Load the Excel workbook
|
| 29 |
-
print(f"Reached: parse_excel")
|
| 30 |
try:
|
| 31 |
xls = pd.ExcelFile(path)
|
| 32 |
except FileNotFoundError:
|
|
@@ -59,7 +59,7 @@ def ocr_image(path: str) -> str:
|
|
| 59 |
- Expects that Tesseract is installed on the host machine.
|
| 60 |
- If the file is missing or unreadable, returns an error string.
|
| 61 |
"""
|
| 62 |
-
print(f"Reached: ocr_image")
|
| 63 |
file = Path(path)
|
| 64 |
if not file.exists():
|
| 65 |
return f"Error: could not find image at {path}"
|
|
|
|
| 10 |
Returns:
|
| 11 |
The search results.
|
| 12 |
"""
|
| 13 |
+
print(f"Reached: web_search: {query}")
|
| 14 |
ddg = DuckDuckGoSearchRun()
|
| 15 |
return ddg.run(query)
|
| 16 |
|
|
|
|
| 26 |
"[{'Name': 'Alice', 'Score': 95}, {'Name': 'Bob', 'Score': 88}, ...]"
|
| 27 |
"""
|
| 28 |
# 1. Load the Excel workbook
|
| 29 |
+
print(f"Reached: parse_excel: {path} {sheet_name}")
|
| 30 |
try:
|
| 31 |
xls = pd.ExcelFile(path)
|
| 32 |
except FileNotFoundError:
|
|
|
|
| 59 |
- Expects that Tesseract is installed on the host machine.
|
| 60 |
- If the file is missing or unreadable, returns an error string.
|
| 61 |
"""
|
| 62 |
+
print(f"Reached: ocr_image: {path}")
|
| 63 |
file = Path(path)
|
| 64 |
if not file.exists():
|
| 65 |
return f"Error: could not find image at {path}"
|