File size: 324 Bytes
f5dc70c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from smolagents import Tool


class TextTransformerTool(Tool):
    name = "text_transformer"
    description = "Reverses the input text."

    inputs = {
        "text": {"type": "string", "description": "Text to reverse."}
    }
    output_type = "string"

    def forward(self, text: str) -> str:
        return text[::-1]