Spaces:
Runtime error
Runtime error
Download agent/tools/__init__.py from TheAbyss99/abyss-api: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/agent/tools/__init__.py
- Command line
-
hf download hf://spaces/TheAbyss99/abyss-api/agent/tools/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/agent/tools/__init__.py
668 Bytes
| from .search import search | |
| from .calculator import calculate | |
| from .code_runner import run_code | |
| from .files import file_op | |
| from server.safety.toolguard import screen_tool_call | |
| TOOLS = { | |
| "search": search, | |
| "calc": calculate, | |
| "code": run_code, | |
| "file": file_op, | |
| } | |
| def dispatch(tool_name: str, args: str) -> str: | |
| # Phase W: screen + audit every tool call before it runs. | |
| allowed, message = screen_tool_call(tool_name, args) | |
| if not allowed: | |
| return message | |
| fn = TOOLS.get(tool_name.lower()) | |
| if fn is None: | |
| return f"Unknown tool '{tool_name}'. Available: {', '.join(TOOLS)}" | |
| return fn(args) |