scalebox-sdk 0.1.13__py3-none-any.whl → 0.1.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
scalebox/__init__.py CHANGED
@@ -9,7 +9,7 @@ A multi-language code execution sandbox with support for:
9
9
  - Real-time callbacks and monitoring
10
10
  """
11
11
 
12
- __version__ = "0.1.13"
12
+ __version__ = "0.1.14"
13
13
  __author__ = "ScaleBox Team"
14
14
  __email__ = "dev@scalebox.dev"
15
15
 
scalebox/api/__init__.py CHANGED
@@ -67,8 +67,8 @@ class ApiClient(AuthenticatedClient):
67
67
  if config.api_key is None:
68
68
  raise AuthenticationException(
69
69
  "API key is required, please visit the Team tab at https://dev/dashboard to get your API key. "
70
- "You can either set the environment variable `E2B_API_KEY` "
71
- 'or you can pass it directly to the sandbox like Sandbox(api_key="e2b_...")',
70
+ "You can either set the environment variable `SBX_API_KEY` "
71
+ 'or you can pass it directly to the sandbox like Sandbox(api_key="sbx_...")',
72
72
  )
73
73
  token = config.api_key
74
74
 
@@ -76,7 +76,7 @@ class ApiClient(AuthenticatedClient):
76
76
  if config.access_token is None:
77
77
  raise AuthenticationException(
78
78
  "Access token is required, please visit the Personal tab at https://dev/dashboard to get your access token. "
79
- "You can set the environment variable `E2B_ACCESS_TOKEN` or pass the `access_token` in options.",
79
+ "You can set the environment variable `SBX_ACCESS_TOKEN` or pass the `access_token` in options.",
80
80
  )
81
81
  token = config.access_token
82
82
 
@@ -1,4 +1,4 @@
1
- """A client library for accessing E2B API"""
1
+ """A client library for accessing Scalebox API"""
2
2
 
3
3
  from .client import AuthenticatedClient, Client
4
4
 
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
28
28
 
29
29
  class AsyncSandbox(BaseAsyncSandbox):
30
30
  """
31
- E2B cloud sandbox is a secure and isolated cloud environment.
31
+ Scalebox cloud sandbox is a secure and isolated cloud environment.
32
32
 
33
33
  The sandbox allows you to:
34
34
  - Access Linux OS
@@ -37,13 +37,13 @@ class AsyncSandbox(BaseAsyncSandbox):
37
37
  - Run isolated code
38
38
  - Access the internet
39
39
 
40
- Check docs [here](https://e2b.dev/docs).
40
+ Check docs for more information.
41
41
 
42
42
  Use the `AsyncSandbox.create()` to create a new sandbox.
43
43
 
44
44
  Example:
45
45
  ```python
46
- from e2b_code_interpreter import AsyncSandbox
46
+ from scalebox.code_interpreter import AsyncSandbox
47
47
  sandbox = await AsyncSandbox.create()
48
48
  ```
49
49
  """
@@ -27,7 +27,7 @@ logger = logging.getLogger(__name__)
27
27
 
28
28
  class Sandbox(BaseSandbox):
29
29
  """
30
- E2B cloud sandbox is a secure and isolated cloud environment.
30
+ Scalebox cloud sandbox is a secure and isolated cloud environment.
31
31
 
32
32
  The sandbox allows you to:
33
33
  - Access Linux OS
@@ -36,7 +36,7 @@ class Sandbox(BaseSandbox):
36
36
  - Run isolated code
37
37
  - Access the internet
38
38
 
39
- Check docs [here](https://.dev/docs).
39
+ Check docs for more information.
40
40
 
41
41
  Use the `Sandbox()` to create a new sandbox.
42
42
 
@@ -228,10 +228,10 @@ class Sandbox(SandboxBase):
228
228
  # :param timeout: Timeout for the sandbox in **seconds**, default to 300 seconds. Maximum time a sandbox can be kept alive is 24 hours (86_400 seconds) for Pro users and 1 hour (3_600 seconds) for Hobby users
229
229
  # :param metadata: Custom metadata for the sandbox
230
230
  # :param envs: Custom environment variables for the sandbox
231
- # :param api_key: E2B API Key to use for authentication, defaults to `E2B_API_KEY` environment variable
232
- # :param domain: E2B domain to use for authentication, defaults to `E2B_DOMAIN` environment variable
233
- # :param debug: If True, the sandbox will be created in debug mode, defaults to `E2B_DEBUG` environment variable
234
- # :param sandbox_id: Sandbox ID to connect to, defaults to `E2B_SANDBOX_ID` environment variable
231
+ # :param api_key: API Key to use for authentication, defaults to `SBX_API_KEY` environment variable
232
+ # :param domain: Domain to use for authentication, defaults to `SBX_DOMAIN` environment variable
233
+ # :param debug: If True, the sandbox will be created in debug mode, defaults to `SBX_DEBUG` environment variable
234
+ # :param sandbox_id: Sandbox ID to connect to, defaults to `SBX_SANDBOX_ID` environment variable
235
235
  # :param request_timeout: Timeout for the request in **seconds**
236
236
  # :param proxy: Proxy to use for the request and for the requests made to the returned sandbox
237
237
  #
@@ -1,34 +1,34 @@
1
- import asyncio
2
- import time
3
-
4
- from scalebox.code_interpreter import AsyncSandbox
5
-
6
- # from scalebox.sandbox_async.main import AsyncSandbox
7
-
8
-
9
- async def pty_output_handler(output):
10
- """处理 PTY 输出的回调函数"""
11
- print(f"输出: {output}")
12
-
13
-
14
- async def main():
15
- sandbox = AsyncSandbox.create()
16
- proc = await sandbox.run_code(
17
- """
18
- import time
19
- for i in range(3):
20
- print("Hello E2B", i)
21
- time.sleep(50)
22
- """,
23
- language="python3",
24
- request_timeout=3600,
25
- on_stdout=pty_output_handler,
26
- on_stderr=pty_output_handler,
27
- on_result=pty_output_handler,
28
- )
29
- print(proc)
30
- time.sleep(10)
31
-
32
-
33
- if __name__ == "__main__":
34
- asyncio.run(main())
1
+ import asyncio
2
+ import time
3
+
4
+ from scalebox.code_interpreter import AsyncSandbox
5
+
6
+ # from scalebox.sandbox_async.main import AsyncSandbox
7
+
8
+
9
+ async def pty_output_handler(output):
10
+ """处理 PTY 输出的回调函数"""
11
+ print(f"输出: {output}")
12
+
13
+
14
+ async def main():
15
+ sandbox = AsyncSandbox.create()
16
+ proc = await sandbox.run_code(
17
+ """
18
+ import time
19
+ for i in range(3):
20
+ print("Hello Scalebox", i)
21
+ time.sleep(50)
22
+ """,
23
+ language="python3",
24
+ request_timeout=3600,
25
+ on_stdout=pty_output_handler,
26
+ on_stderr=pty_output_handler,
27
+ on_result=pty_output_handler,
28
+ )
29
+ print(proc)
30
+ time.sleep(10)
31
+
32
+
33
+ if __name__ == "__main__":
34
+ asyncio.run(main())
@@ -1,34 +1,34 @@
1
- import asyncio
2
- import time
3
-
4
- from code_interpreter import Sandbox
5
-
6
- # from scalebox.sandbox_async.main import AsyncSandbox
7
-
8
-
9
- def pty_output_handler(output):
10
- """处理 PTY 输出的回调函数"""
11
- print(f"输出: {output}")
12
-
13
-
14
- def main():
15
- sandbox = Sandbox()
16
- proc = sandbox.run_code(
17
- """
18
- import time
19
- for i in range(3):
20
- print("Hello E2B", i)
21
- time.sleep(50)
22
- """,
23
- language="python3",
24
- request_timeout=3600,
25
- on_stdout=pty_output_handler,
26
- on_stderr=pty_output_handler,
27
- on_result=pty_output_handler,
28
- )
29
- print(proc)
30
- time.sleep(10)
31
-
32
-
33
- if __name__ == "__main__":
34
- main()
1
+ import asyncio
2
+ import time
3
+
4
+ from code_interpreter import Sandbox
5
+
6
+ # from scalebox.sandbox_async.main import AsyncSandbox
7
+
8
+
9
+ def pty_output_handler(output):
10
+ """处理 PTY 输出的回调函数"""
11
+ print(f"输出: {output}")
12
+
13
+
14
+ def main():
15
+ sandbox = Sandbox()
16
+ proc = sandbox.run_code(
17
+ """
18
+ import time
19
+ for i in range(3):
20
+ print("Hello Scalebox", i)
21
+ time.sleep(50)
22
+ """,
23
+ language="python3",
24
+ request_timeout=3600,
25
+ on_stdout=pty_output_handler,
26
+ on_stderr=pty_output_handler,
27
+ on_result=pty_output_handler,
28
+ )
29
+ print(proc)
30
+ time.sleep(10)
31
+
32
+
33
+ if __name__ == "__main__":
34
+ main()