| from smolagents import Tool | |
| import os | |
| import requests | |
| class GetPlaceholderImageTool(Tool): | |
| name = "get_placeholder_image_tool" | |
| description = "Get placeholder image for website with specific size" | |
| inputs = { | |
| "height": {"type": "integer", "description": "The height of the placeholder"}, | |
| "width": {"type": "integer", "description": "The width of the placeholder"}, | |
| } | |
| output_type = "string" | |
| def forward(self, height: int, width: int) -> str: | |
| return f"https://placehold.co/{width}x{height}" |