add_numbers_tool / tool.py
Sukmadi's picture
Upload tool
bff9c0a verified
raw
history blame contribute delete
506 Bytes
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