Spaces:
Build error
Build error
| 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 | |
| ) | |