File size: 547 Bytes
77c658d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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}"