test-agent2 / tools /simple_tool.py
rogerscuall's picture
Upload agent
0bd76cd verified
raw
history blame contribute delete
533 Bytes
from smolagents import Tool
from typing import Any, Optional
class SimpleTool(Tool):
name = "simple_tool"
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, world!"