__init__.py 715 B

12345678910111213141516171819202122232425262728293031
  1. from .docker.local_box import LocalBox
  2. from .docker.ssh_box import DockerSSHBox
  3. from .e2b.sandbox import E2BBox
  4. from .sandbox import Sandbox
  5. def get_runtime_cls(name: str):
  6. # Local imports to avoid circular imports
  7. if name == 'server':
  8. from .server.runtime import ServerRuntime
  9. return ServerRuntime
  10. elif name == 'eventstream':
  11. from .client.runtime import EventStreamRuntime
  12. return EventStreamRuntime
  13. elif name == 'e2b':
  14. from .e2b.runtime import E2BRuntime
  15. return E2BRuntime
  16. else:
  17. raise ValueError(f'Runtime {name} not supported')
  18. __all__ = [
  19. 'DockerSSHBox',
  20. 'E2BBox',
  21. 'LocalBox',
  22. 'Sandbox',
  23. 'get_runtime_cls',
  24. ]