|
11 | 11 | from e2b.connection_config import ConnectionConfig, ApiParams |
12 | 12 | from e2b.envd.api import ENVD_API_HEALTH_ROUTE, ahandle_envd_api_exception |
13 | 13 | from e2b.exceptions import format_request_timeout_error, SandboxException |
14 | | -from e2b.sandbox.main import SandboxSetup |
15 | 14 | from e2b.sandbox.sandbox_api import SandboxMetrics |
16 | 15 | from e2b.sandbox.utils import class_method_variant |
17 | 16 | from e2b.sandbox_async.filesystem.filesystem import Filesystem |
@@ -46,7 +45,7 @@ class AsyncSandboxOpts(TypedDict): |
46 | 45 | connection_config: ConnectionConfig |
47 | 46 |
|
48 | 47 |
|
49 | | -class AsyncSandbox(SandboxSetup, SandboxApi): |
| 48 | +class AsyncSandbox(SandboxApi): |
50 | 49 | """ |
51 | 50 | E2B cloud sandbox is a secure and isolated cloud environment. |
52 | 51 |
|
@@ -195,7 +194,7 @@ async def create( |
195 | 194 | envd_version = None |
196 | 195 | envd_access_token = None |
197 | 196 | else: |
198 | | - response = await SandboxApi._create_sandbox( |
| 197 | + response = await cls._create_sandbox( |
199 | 198 | template=template or cls.default_template, |
200 | 199 | timeout=timeout or cls.default_sandbox_timeout, |
201 | 200 | metadata=metadata, |
@@ -251,7 +250,7 @@ async def connect( |
251 | 250 | # Another code block |
252 | 251 | same_sandbox = await AsyncSandbox.connect(sandbox_id) |
253 | 252 | """ |
254 | | - response = await SandboxApi._cls_get_info(sandbox_id, **opts) |
| 253 | + response = await cls._cls_get_info(sandbox_id, **opts) |
255 | 254 |
|
256 | 255 | sandbox_headers = {} |
257 | 256 | envd_access_token = response._envd_access_token |
@@ -314,7 +313,7 @@ async def kill( |
314 | 313 |
|
315 | 314 | :return: `True` if the sandbox was killed, `False` if the sandbox was not found |
316 | 315 | """ |
317 | | - return await SandboxApi._cls_kill( |
| 316 | + return await self._cls_kill( |
318 | 317 | sandbox_id=self.sandbox_id, |
319 | 318 | **self.connection_config.get_api_params(**opts), |
320 | 319 | ) |
@@ -370,7 +369,7 @@ async def set_timeout( # type: ignore |
370 | 369 |
|
371 | 370 | :param timeout: Timeout for the sandbox in **seconds** |
372 | 371 | """ |
373 | | - await SandboxApi._cls_set_timeout( |
| 372 | + await self._cls_set_timeout( |
374 | 373 | sandbox_id=self.sandbox_id, |
375 | 374 | timeout=timeout, |
376 | 375 | **self.connection_config.get_api_params(**opts), |
@@ -413,7 +412,7 @@ async def get_info( |
413 | 412 | :return: Sandbox info |
414 | 413 | """ |
415 | 414 |
|
416 | | - return await SandboxApi._cls_get_info( |
| 415 | + return await self._cls_get_info( |
417 | 416 | sandbox_id=self.sandbox_id, |
418 | 417 | **self.connection_config.get_api_params(**opts), |
419 | 418 | ) |
|
0 commit comments