scalebox-sdk 0.1.25__py3-none-any.whl → 1.0.2__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 +2 -2
- scalebox/api/__init__.py +3 -1
- scalebox/api/client/api/sandboxes/get_sandboxes.py +1 -1
- scalebox/api/client/api/sandboxes/post_sandboxes_sandbox_id_connect.py +193 -0
- scalebox/api/client/models/connect_sandbox.py +59 -0
- scalebox/api/client/models/error.py +2 -2
- scalebox/api/client/models/listed_sandbox.py +24 -3
- scalebox/api/client/models/new_sandbox.py +10 -0
- scalebox/api/client/models/sandbox.py +13 -0
- scalebox/api/client/models/sandbox_detail.py +24 -0
- scalebox/cli.py +125 -125
- scalebox/client/aclient.py +57 -57
- scalebox/client/client.py +102 -102
- scalebox/code_interpreter/__init__.py +12 -12
- scalebox/code_interpreter/charts.py +230 -230
- scalebox/code_interpreter/code_interpreter_async.py +3 -1
- scalebox/code_interpreter/code_interpreter_sync.py +3 -1
- scalebox/code_interpreter/constants.py +3 -3
- scalebox/code_interpreter/exceptions.py +13 -13
- scalebox/code_interpreter/models.py +485 -485
- scalebox/connection_config.py +36 -1
- scalebox/csx_connect/__init__.py +1 -1
- scalebox/csx_connect/client.py +485 -485
- scalebox/csx_desktop/main.py +651 -651
- scalebox/exceptions.py +83 -83
- scalebox/generated/api.py +61 -61
- scalebox/generated/api_pb2.py +203 -203
- scalebox/generated/api_pb2.pyi +956 -956
- scalebox/generated/api_pb2_connect.py +1407 -1407
- scalebox/generated/rpc.py +50 -50
- scalebox/sandbox/main.py +146 -139
- scalebox/sandbox/sandbox_api.py +105 -91
- scalebox/sandbox/signature.py +40 -40
- scalebox/sandbox/utils.py +34 -34
- scalebox/sandbox_async/main.py +226 -44
- scalebox/sandbox_async/sandbox_api.py +124 -3
- scalebox/sandbox_sync/main.py +205 -130
- scalebox/sandbox_sync/sandbox_api.py +119 -3
- scalebox/test/CODE_INTERPRETER_TESTS_READY.md +323 -323
- scalebox/test/README.md +329 -329
- scalebox/test/bedrock_openai_adapter.py +73 -0
- scalebox/test/code_interpreter_test.py +34 -34
- scalebox/test/code_interpreter_test_sync.py +34 -34
- scalebox/test/run_stress_code_interpreter_sync.py +178 -0
- scalebox/test/simple_upload_example.py +131 -0
- scalebox/test/stabitiy_test.py +323 -0
- scalebox/test/test_browser_use.py +27 -0
- scalebox/test/test_browser_use_scalebox.py +62 -0
- scalebox/test/test_code_interpreter_execcode.py +289 -211
- scalebox/test/test_code_interpreter_sync_comprehensive.py +116 -69
- scalebox/test/test_connect_pause_async.py +300 -0
- scalebox/test/test_connect_pause_sync.py +300 -0
- scalebox/test/test_csx_desktop_examples.py +3 -3
- scalebox/test/test_desktop_sandbox_sf.py +112 -0
- scalebox/test/test_download_url.py +41 -0
- scalebox/test/test_existing_sandbox.py +1037 -0
- scalebox/test/test_sandbox_async_comprehensive.py +5 -3
- scalebox/test/test_sandbox_object_storage_example.py +151 -0
- scalebox/test/test_sandbox_object_storage_example_async.py +159 -0
- scalebox/test/test_sandbox_sync_comprehensive.py +1 -1
- scalebox/test/test_sf.py +141 -0
- scalebox/test/test_watch_dir_async.py +58 -0
- scalebox/test/testacreate.py +1 -1
- scalebox/test/testagetinfo.py +1 -3
- scalebox/test/testcomputeuse.py +243 -243
- scalebox/test/testsandbox_api.py +5 -5
- scalebox/test/testsandbox_async.py +17 -47
- scalebox/test/testsandbox_sync.py +19 -15
- scalebox/test/upload_100mb_example.py +377 -0
- scalebox/utils/httpcoreclient.py +297 -297
- scalebox/utils/httpxclient.py +403 -403
- scalebox/version.py +2 -2
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/METADATA +1 -1
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/RECORD +78 -60
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/WHEEL +1 -1
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/entry_points.txt +0 -0
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {scalebox_sdk-0.1.25.dist-info → scalebox_sdk-1.0.2.dist-info}/top_level.txt +0 -0
scalebox/connection_config.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from typing import Dict, Literal, Optional
|
|
2
|
+
from typing import Dict, Literal, Optional, TypedDict
|
|
3
3
|
|
|
4
4
|
from httpx._types import ProxyTypes
|
|
5
5
|
|
|
@@ -11,6 +11,35 @@ KEEPALIVE_PING_INTERVAL_SEC = 50 # 50 seconds
|
|
|
11
11
|
KEEPALIVE_PING_HEADER = "Keepalive-Ping-Interval"
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
class ApiParams(TypedDict, total=False):
|
|
15
|
+
"""
|
|
16
|
+
Parameters for a request.
|
|
17
|
+
|
|
18
|
+
In the case of a sandbox, it applies to all **requests made to the returned sandbox**.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
request_timeout: Optional[float]
|
|
22
|
+
"""Timeout for the request in **seconds**, defaults to 60 seconds."""
|
|
23
|
+
|
|
24
|
+
headers: Optional[Dict[str, str]]
|
|
25
|
+
"""Additional headers to send with the request."""
|
|
26
|
+
|
|
27
|
+
api_key: Optional[str]
|
|
28
|
+
"""SBX API Key to use for authentication, defaults to `SBX_API_KEY` environment variable."""
|
|
29
|
+
|
|
30
|
+
domain: Optional[str]
|
|
31
|
+
"""SBX domain to use for authentication, defaults to `SBX_DOMAIN` environment variable."""
|
|
32
|
+
|
|
33
|
+
api_url: Optional[str]
|
|
34
|
+
"""URL to use for the API, defaults to `https://api.<domain>`. For internal use only."""
|
|
35
|
+
|
|
36
|
+
debug: Optional[bool]
|
|
37
|
+
"""Whether to use debug mode, defaults to `SBX_DEBUG` environment variable."""
|
|
38
|
+
|
|
39
|
+
proxy: Optional[ProxyTypes]
|
|
40
|
+
"""Proxy to use for the request. In case of a sandbox it applies to all **requests made to the returned sandbox**."""
|
|
41
|
+
|
|
42
|
+
|
|
14
43
|
class ConnectionConfig:
|
|
15
44
|
"""
|
|
16
45
|
Configuration for the connection to the API.
|
|
@@ -32,6 +61,10 @@ class ConnectionConfig:
|
|
|
32
61
|
def _access_token():
|
|
33
62
|
return os.getenv("SBX_ACCESS_TOKEN")
|
|
34
63
|
|
|
64
|
+
@staticmethod
|
|
65
|
+
def _debug_host():
|
|
66
|
+
return os.getenv("SBX_DEBUG_HOST") or "localhost"
|
|
67
|
+
|
|
35
68
|
def __init__(
|
|
36
69
|
self,
|
|
37
70
|
domain: Optional[str] = None,
|
|
@@ -41,11 +74,13 @@ class ConnectionConfig:
|
|
|
41
74
|
request_timeout: Optional[float] = None,
|
|
42
75
|
headers: Optional[Dict[str, str]] = None,
|
|
43
76
|
proxy: Optional[ProxyTypes] = None,
|
|
77
|
+
debug_host: Optional[str] = None,
|
|
44
78
|
):
|
|
45
79
|
self.domain = domain or ConnectionConfig._domain()
|
|
46
80
|
self.debug = debug or ConnectionConfig._debug()
|
|
47
81
|
self.api_key = api_key or ConnectionConfig._api_key()
|
|
48
82
|
self.access_token = access_token or ConnectionConfig._access_token()
|
|
83
|
+
self.debug_host = debug_host or ConnectionConfig._debug_host()
|
|
49
84
|
self.headers = headers or {}
|
|
50
85
|
# self.headers["User-Agent"] = f"csx-python-sdk/{package_version}"
|
|
51
86
|
|
scalebox/csx_connect/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
from .client import Client, Code, ConnectException, GzipCompressor # noqa: F401
|
|
1
|
+
from .client import Client, Code, ConnectException, GzipCompressor # noqa: F401
|