Update tools.py
Browse files
tools.py
CHANGED
|
@@ -5,8 +5,9 @@ import pytesseract
|
|
| 5 |
from PIL import Image
|
| 6 |
from smolagents import tool, FinalAnswerTool, DuckDuckGoSearchTool, ToolCollection
|
| 7 |
|
|
|
|
| 8 |
DuckDuckGoSearchTool = DuckDuckGoSearchTool()
|
| 9 |
-
FinalAnswer =
|
| 10 |
|
| 11 |
image_tool_collection = ToolCollection.from_hub("huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f")
|
| 12 |
|
|
@@ -124,3 +125,8 @@ def download_file_from_url(url: str, filename: Optional[str] = None) -> str:
|
|
| 124 |
return f"File downloaded to {filepath}. You can read this file to process its contents."
|
| 125 |
except Exception as e:
|
| 126 |
return f"Error downloading file: {str(e)}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
from smolagents import tool, FinalAnswerTool, DuckDuckGoSearchTool, ToolCollection
|
| 7 |
|
| 8 |
+
|
| 9 |
DuckDuckGoSearchTool = DuckDuckGoSearchTool()
|
| 10 |
+
FinalAnswer = FinalAnswerTool()
|
| 11 |
|
| 12 |
image_tool_collection = ToolCollection.from_hub("huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f")
|
| 13 |
|
|
|
|
| 125 |
return f"File downloaded to {filepath}. You can read this file to process its contents."
|
| 126 |
except Exception as e:
|
| 127 |
return f"Error downloading file: {str(e)}"
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
all_tools = [DuckDuckGoSearchTool, FinalAnswer, *image_tool_collection,
|
| 131 |
+
multiply, add, subtract, divide, modulus, power, square_root,
|
| 132 |
+
download_file_from_url]
|