from smolagents import Tool #AUTHORIZED_TYPES = [ # "string", # "boolean", # "integer", # "number", # "image", # "audio", # "array", # "object", # "any", # "null", #] class ReverseStringTool(Tool): name = "_my_tool_reverse_string" description = """ Decode a string which is provided in a reversed form To invoke the tool use code as below reversed_string = _my_tool_reverse_string(input_str="dummy") """ inputs = { "input_str": { "type": "string", "description": "encoded input string", } } output_type = "string" def forward(self, input_str: str) -> str: _out = "" for a in input_str: _out = a + _out return _out