Spaces:
Build error
Build error
Download tools/simple_tool.py from rogerscuall/test-agent2: direct link, hf CLI and curl.
- Browser
- Download file 533 Bytes
-
https://huggingface.co/spaces/rogerscuall/test-agent2/resolve/main/tools/simple_tool.py
- Command line
-
hf download hf://spaces/rogerscuall/test-agent2/tools/simple_tool.py
-
curl -L -o simple_tool.py https://huggingface.co/spaces/rogerscuall/test-agent2/resolve/main/tools/simple_tool.py
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!" |