WebpageCreator / myTools /GetPlaceholderImageTool.py
Houzeric's picture
Upload 29 files
77c658d verified
raw
history blame contribute delete
547 Bytes
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}"