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

class SimpleTool(Tool):
    name = "add_numbers"
    description = "Adds two numbers."
    inputs = {'a': {'type': 'integer', 'description': 'The first number.'}, 'b': {'type': 'integer', 'description': 'The second number.'}}
    output_type = "integer"

    def forward(self, a: int, b: int) -> int:
        """Adds two numbers.

        Args:
            a: The first number.
            b: The second number.
        """
        return a + b