Spaces:
Build error
Build error
Download src/infrastructure/tools/shell.py from fariasultanacodes/gemini-agent: direct link, hf CLI and curl.
- Browser
- Download file 807 Bytes
-
https://huggingface.co/spaces/fariasultanacodes/gemini-agent/resolve/main/src/infrastructure/tools/shell.py
- Command line
-
hf download hf://spaces/fariasultanacodes/gemini-agent/src/infrastructure/tools/shell.py
-
curl -L -o shell.py https://huggingface.co/spaces/fariasultanacodes/gemini-agent/resolve/main/src/infrastructure/tools/shell.py
807 Bytes
| from src.infrastructure.tools.registry import tool_registry | |
| from src.infrastructure.sandbox.docker_manager import docker_sandbox | |
| async def shell_execute(session_id: str, command: str) -> str: | |
| """Execute a shell command in the sandbox""" | |
| if not docker_sandbox: | |
| return "Error: Sandbox unavailable" | |
| return await docker_sandbox.execute_shell(session_id, command) | |
| tool_registry.register( | |
| name="shell_execute", | |
| description="Execute a shell command in the sandbox", | |
| parameters={ | |
| "type": "OBJECT", | |
| "properties": { | |
| "session_id": {"type": "STRING", "description": "The session ID"}, | |
| "command": {"type": "STRING", "description": "The command to execute"} | |
| }, | |
| "required": ["session_id", "command"] | |
| }, | |
| func=shell_execute | |
| ) | |