File size: 510 Bytes
a6fe20b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from smolagents import Tool


class AdditionTool(Tool):
    name = "add_numbers"
    description = """
    This is a tool that adds two numbers."""
    inputs = {
        "a": {
            "type": "number",
            "description": "the first number",
        },
        "b": {
            "type": "number",
            "description": "the second number",
        },
    }
    output_type = "number"

    def forward(self, a: float, b: float) -> float:
        return a + b


addition_tool = AdditionTool()