File size: 537 Bytes
84bc535
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from smolagents import Tool
from typing import Any, Optional

class SimpleTool(Tool):
    name = "simple_tool1"
    description = "A simple tool that returns a string."
    inputs = {"msg":{"type":"string","description":"A string message."}}
    output_type = "string"

    def forward(self, msg: str)->str:
        """
        A simple tool that returns a string.
        Args:
            msg: A string message.
        Returns:
            str: The same string message.
        """
        print(msg)
        return "Hello, tomorrow!"