Download external_content/external_tools/starter_custom_tool.py from Ransom070/Ante: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/Ransom070/Ante/resolve/main/external_content/external_tools/starter_custom_tool.py
- Command line
-
hf download hf://spaces/Ransom070/Ante/external_content/external_tools/starter_custom_tool.py
-
curl -L -o starter_custom_tool.py https://huggingface.co/spaces/Ransom070/Ante/resolve/main/external_content/external_tools/starter_custom_tool.py
1.04 kB
| """Example external tool implementation.""" | |
| import logging | |
| from typing import Any | |
| from reachy_mini_conversation_app.tools.core_tools import Tool, ToolDependencies | |
| logger = logging.getLogger(__name__) | |
| class StarterCustomTool(Tool): | |
| """Demonstrate loading a tool from the external tools directory.""" | |
| name = "starter_custom_tool" | |
| description = "A placeholder custom tool loaded from outside the library" | |
| parameters_schema = { | |
| "type": "object", | |
| "properties": { | |
| "message": { | |
| "type": "string", | |
| "description": "Optional message to include in the response", | |
| }, | |
| }, | |
| "required": [], | |
| } | |
| async def __call__(self, deps: ToolDependencies, **kwargs: Any) -> dict[str, Any]: | |
| """Return the requested message from the external tool.""" | |
| message = kwargs.get("message", "Hello from custom tool!") | |
| logger.info("Tool call: starter_custom_tool message=%s", message) | |
| return {"status": "success", "message": message} | |