blaxel 0.1.16rc60__py3-none-any.whl → 0.1.18__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.
- blaxel/authentication/clientcredentials.py +1 -1
- blaxel/client/api/jobs/__init__.py +0 -0
- blaxel/client/api/{default/get_template_file_contents.py → jobs/create_job.py} +57 -44
- blaxel/client/api/jobs/delete_job.py +154 -0
- blaxel/client/api/{default/get_template_contents.py → jobs/get_job.py} +43 -30
- blaxel/client/api/jobs/list_job_revisions.py +159 -0
- blaxel/client/api/jobs/list_jobs.py +135 -0
- blaxel/client/api/jobs/update_job.py +179 -0
- blaxel/client/models/__init__.py +34 -0
- blaxel/client/models/job.py +129 -0
- blaxel/client/models/job_execution_config.py +79 -0
- blaxel/client/models/job_metrics.py +199 -0
- blaxel/client/models/job_metrics_executions_chart.py +45 -0
- blaxel/client/models/job_metrics_executions_total.py +45 -0
- blaxel/client/models/job_metrics_tasks_chart.py +45 -0
- blaxel/client/models/job_metrics_tasks_total.py +45 -0
- blaxel/client/models/job_spec.py +208 -0
- blaxel/client/models/jobs_chart.py +94 -0
- blaxel/client/models/jobs_chart_value.py +70 -0
- blaxel/client/models/jobs_executions.py +88 -0
- blaxel/client/models/jobs_network_chart.py +94 -0
- blaxel/client/models/jobs_success_failed_chart.py +139 -0
- blaxel/client/models/jobs_tasks.py +88 -0
- blaxel/client/models/jobs_total.py +97 -0
- blaxel/client/models/preview_spec.py +55 -1
- blaxel/client/models/preview_spec_request_headers.py +48 -0
- blaxel/{sandbox/client/models/get_process_identifier_logs_response_200.py → client/models/preview_spec_response_headers.py} +6 -6
- blaxel/client/models/runtime.py +18 -0
- blaxel/client/models/serverless_config.py +9 -0
- blaxel/common/internal.py +0 -2
- blaxel/common/logger.py +14 -6
- blaxel/instrumentation/manager.py +1 -1
- blaxel/jobs/__init__.py +4 -8
- blaxel/sandbox/client/api/filesystem/delete_filesystem_path.py +4 -0
- blaxel/sandbox/client/api/filesystem/get_filesystem_path.py +4 -0
- blaxel/sandbox/client/api/filesystem/get_watch_filesystem_path.py +22 -1
- blaxel/sandbox/client/api/filesystem/put_filesystem_path.py +8 -4
- blaxel/sandbox/client/api/network/delete_network_process_pid_monitor.py +4 -0
- blaxel/sandbox/client/api/network/get_network_process_pid_ports.py +4 -0
- blaxel/sandbox/client/api/network/post_network_process_pid_monitor.py +4 -0
- blaxel/sandbox/client/api/process/delete_process_identifier.py +4 -0
- blaxel/sandbox/client/api/process/delete_process_identifier_kill.py +4 -0
- blaxel/sandbox/client/api/process/get_process_identifier_logs.py +16 -16
- blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +4 -0
- blaxel/sandbox/client/api/process/get_ws_process_identifier_logs_stream.py +8 -8
- blaxel/sandbox/client/api/process/post_process.py +4 -0
- blaxel/sandbox/client/models/__init__.py +4 -2
- blaxel/sandbox/client/models/directory.py +9 -0
- blaxel/sandbox/client/models/file.py +9 -0
- blaxel/sandbox/client/models/file_with_content.py +9 -0
- blaxel/sandbox/client/models/process_logs.py +78 -0
- blaxel/sandbox/client/models/process_response.py +12 -4
- blaxel/sandbox/client/models/process_response_status.py +12 -0
- blaxel/sandbox/client/models/subdirectory.py +9 -0
- blaxel/sandbox/preview.py +13 -17
- blaxel/sandbox/process.py +8 -9
- blaxel-0.1.18.dist-info/METADATA +169 -0
- {blaxel-0.1.16rc60.dist-info → blaxel-0.1.18.dist-info}/RECORD +60 -37
- blaxel-0.1.16rc60.dist-info/METADATA +0 -397
- {blaxel-0.1.16rc60.dist-info → blaxel-0.1.18.dist-info}/WHEEL +0 -0
- {blaxel-0.1.16rc60.dist-info → blaxel-0.1.18.dist-info}/licenses/LICENSE +0 -0
@@ -28,6 +28,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
28
28
|
response_404 = ErrorResponse.from_dict(response.json())
|
29
29
|
|
30
30
|
return response_404
|
31
|
+
if response.status_code == 422:
|
32
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
33
|
+
|
34
|
+
return response_422
|
31
35
|
if response.status_code == 500:
|
32
36
|
response_500 = ErrorResponse.from_dict(response.json())
|
33
37
|
|
@@ -54,8 +58,7 @@ def sync_detailed(
|
|
54
58
|
) -> Response[Union[ErrorResponse, str]]:
|
55
59
|
"""Stream process logs in real time via WebSocket
|
56
60
|
|
57
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
58
|
-
process exits or the client disconnects.
|
61
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
59
62
|
|
60
63
|
Args:
|
61
64
|
identifier (str):
|
@@ -86,8 +89,7 @@ def sync(
|
|
86
89
|
) -> Optional[Union[ErrorResponse, str]]:
|
87
90
|
"""Stream process logs in real time via WebSocket
|
88
91
|
|
89
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
90
|
-
process exits or the client disconnects.
|
92
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
91
93
|
|
92
94
|
Args:
|
93
95
|
identifier (str):
|
@@ -113,8 +115,7 @@ async def asyncio_detailed(
|
|
113
115
|
) -> Response[Union[ErrorResponse, str]]:
|
114
116
|
"""Stream process logs in real time via WebSocket
|
115
117
|
|
116
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
117
|
-
process exits or the client disconnects.
|
118
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
118
119
|
|
119
120
|
Args:
|
120
121
|
identifier (str):
|
@@ -143,8 +144,7 @@ async def asyncio(
|
|
143
144
|
) -> Optional[Union[ErrorResponse, str]]:
|
144
145
|
"""Stream process logs in real time via WebSocket
|
145
146
|
|
146
|
-
Streams the stdout and stderr output of a process in real time as JSON messages.
|
147
|
-
process exits or the client disconnects.
|
147
|
+
Streams the stdout and stderr output of a process in real time as JSON messages.
|
148
148
|
|
149
149
|
Args:
|
150
150
|
identifier (str):
|
@@ -43,6 +43,10 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Uni
|
|
43
43
|
response_400 = ErrorResponse.from_dict(response.json())
|
44
44
|
|
45
45
|
return response_400
|
46
|
+
if response.status_code == 422:
|
47
|
+
response_422 = ErrorResponse.from_dict(response.json())
|
48
|
+
|
49
|
+
return response_422
|
46
50
|
if response.status_code == 500:
|
47
51
|
response_500 = ErrorResponse.from_dict(response.json())
|
48
52
|
|
@@ -9,12 +9,13 @@ from .file import File
|
|
9
9
|
from .file_request import FileRequest
|
10
10
|
from .file_with_content import FileWithContent
|
11
11
|
from .get_network_process_pid_ports_response_200 import GetNetworkProcessPidPortsResponse200
|
12
|
-
from .get_process_identifier_logs_response_200 import GetProcessIdentifierLogsResponse200
|
13
12
|
from .port_monitor_request import PortMonitorRequest
|
14
13
|
from .post_network_process_pid_monitor_response_200 import PostNetworkProcessPidMonitorResponse200
|
15
14
|
from .process_kill_request import ProcessKillRequest
|
15
|
+
from .process_logs import ProcessLogs
|
16
16
|
from .process_request import ProcessRequest
|
17
17
|
from .process_response import ProcessResponse
|
18
|
+
from .process_response_status import ProcessResponseStatus
|
18
19
|
from .subdirectory import Subdirectory
|
19
20
|
from .success_response import SuccessResponse
|
20
21
|
|
@@ -26,12 +27,13 @@ __all__ = (
|
|
26
27
|
"FileRequest",
|
27
28
|
"FileWithContent",
|
28
29
|
"GetNetworkProcessPidPortsResponse200",
|
29
|
-
"GetProcessIdentifierLogsResponse200",
|
30
30
|
"PortMonitorRequest",
|
31
31
|
"PostNetworkProcessPidMonitorResponse200",
|
32
32
|
"ProcessKillRequest",
|
33
|
+
"ProcessLogs",
|
33
34
|
"ProcessRequest",
|
34
35
|
"ProcessResponse",
|
36
|
+
"ProcessResponseStatus",
|
35
37
|
"Subdirectory",
|
36
38
|
"SuccessResponse",
|
37
39
|
)
|
@@ -18,11 +18,13 @@ class Directory:
|
|
18
18
|
"""
|
19
19
|
Attributes:
|
20
20
|
files (Union[Unset, list['File']]):
|
21
|
+
name (Union[Unset, str]):
|
21
22
|
path (Union[Unset, str]):
|
22
23
|
subdirectories (Union[Unset, list['Subdirectory']]): @name Subdirectories
|
23
24
|
"""
|
24
25
|
|
25
26
|
files: Union[Unset, list["File"]] = UNSET
|
27
|
+
name: Union[Unset, str] = UNSET
|
26
28
|
path: Union[Unset, str] = UNSET
|
27
29
|
subdirectories: Union[Unset, list["Subdirectory"]] = UNSET
|
28
30
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -38,6 +40,8 @@ class Directory:
|
|
38
40
|
files_item = files_item_data.to_dict()
|
39
41
|
files.append(files_item)
|
40
42
|
|
43
|
+
name = self.name
|
44
|
+
|
41
45
|
path = self.path
|
42
46
|
|
43
47
|
subdirectories: Union[Unset, list[dict[str, Any]]] = UNSET
|
@@ -55,6 +59,8 @@ class Directory:
|
|
55
59
|
field_dict.update({})
|
56
60
|
if files is not UNSET:
|
57
61
|
field_dict["files"] = files
|
62
|
+
if name is not UNSET:
|
63
|
+
field_dict["name"] = name
|
58
64
|
if path is not UNSET:
|
59
65
|
field_dict["path"] = path
|
60
66
|
if subdirectories is not UNSET:
|
@@ -77,6 +83,8 @@ class Directory:
|
|
77
83
|
|
78
84
|
files.append(files_item)
|
79
85
|
|
86
|
+
name = d.pop("name", UNSET)
|
87
|
+
|
80
88
|
path = d.pop("path", UNSET)
|
81
89
|
|
82
90
|
subdirectories = []
|
@@ -88,6 +96,7 @@ class Directory:
|
|
88
96
|
|
89
97
|
directory = cls(
|
90
98
|
files=files,
|
99
|
+
name=name,
|
91
100
|
path=path,
|
92
101
|
subdirectories=subdirectories,
|
93
102
|
)
|
@@ -14,6 +14,7 @@ class File:
|
|
14
14
|
Attributes:
|
15
15
|
group (Union[Unset, str]):
|
16
16
|
last_modified (Union[Unset, str]):
|
17
|
+
name (Union[Unset, str]):
|
17
18
|
owner (Union[Unset, str]):
|
18
19
|
path (Union[Unset, str]):
|
19
20
|
permissions (Union[Unset, str]):
|
@@ -22,6 +23,7 @@ class File:
|
|
22
23
|
|
23
24
|
group: Union[Unset, str] = UNSET
|
24
25
|
last_modified: Union[Unset, str] = UNSET
|
26
|
+
name: Union[Unset, str] = UNSET
|
25
27
|
owner: Union[Unset, str] = UNSET
|
26
28
|
path: Union[Unset, str] = UNSET
|
27
29
|
permissions: Union[Unset, str] = UNSET
|
@@ -33,6 +35,8 @@ class File:
|
|
33
35
|
|
34
36
|
last_modified = self.last_modified
|
35
37
|
|
38
|
+
name = self.name
|
39
|
+
|
36
40
|
owner = self.owner
|
37
41
|
|
38
42
|
path = self.path
|
@@ -48,6 +52,8 @@ class File:
|
|
48
52
|
field_dict["group"] = group
|
49
53
|
if last_modified is not UNSET:
|
50
54
|
field_dict["lastModified"] = last_modified
|
55
|
+
if name is not UNSET:
|
56
|
+
field_dict["name"] = name
|
51
57
|
if owner is not UNSET:
|
52
58
|
field_dict["owner"] = owner
|
53
59
|
if path is not UNSET:
|
@@ -68,6 +74,8 @@ class File:
|
|
68
74
|
|
69
75
|
last_modified = d.pop("lastModified", UNSET)
|
70
76
|
|
77
|
+
name = d.pop("name", UNSET)
|
78
|
+
|
71
79
|
owner = d.pop("owner", UNSET)
|
72
80
|
|
73
81
|
path = d.pop("path", UNSET)
|
@@ -79,6 +87,7 @@ class File:
|
|
79
87
|
file = cls(
|
80
88
|
group=group,
|
81
89
|
last_modified=last_modified,
|
90
|
+
name=name,
|
82
91
|
owner=owner,
|
83
92
|
path=path,
|
84
93
|
permissions=permissions,
|
@@ -15,6 +15,7 @@ class FileWithContent:
|
|
15
15
|
content (Union[Unset, str]):
|
16
16
|
group (Union[Unset, str]):
|
17
17
|
last_modified (Union[Unset, str]):
|
18
|
+
name (Union[Unset, str]):
|
18
19
|
owner (Union[Unset, str]):
|
19
20
|
path (Union[Unset, str]):
|
20
21
|
permissions (Union[Unset, str]):
|
@@ -24,6 +25,7 @@ class FileWithContent:
|
|
24
25
|
content: Union[Unset, str] = UNSET
|
25
26
|
group: Union[Unset, str] = UNSET
|
26
27
|
last_modified: Union[Unset, str] = UNSET
|
28
|
+
name: Union[Unset, str] = UNSET
|
27
29
|
owner: Union[Unset, str] = UNSET
|
28
30
|
path: Union[Unset, str] = UNSET
|
29
31
|
permissions: Union[Unset, str] = UNSET
|
@@ -37,6 +39,8 @@ class FileWithContent:
|
|
37
39
|
|
38
40
|
last_modified = self.last_modified
|
39
41
|
|
42
|
+
name = self.name
|
43
|
+
|
40
44
|
owner = self.owner
|
41
45
|
|
42
46
|
path = self.path
|
@@ -54,6 +58,8 @@ class FileWithContent:
|
|
54
58
|
field_dict["group"] = group
|
55
59
|
if last_modified is not UNSET:
|
56
60
|
field_dict["lastModified"] = last_modified
|
61
|
+
if name is not UNSET:
|
62
|
+
field_dict["name"] = name
|
57
63
|
if owner is not UNSET:
|
58
64
|
field_dict["owner"] = owner
|
59
65
|
if path is not UNSET:
|
@@ -76,6 +82,8 @@ class FileWithContent:
|
|
76
82
|
|
77
83
|
last_modified = d.pop("lastModified", UNSET)
|
78
84
|
|
85
|
+
name = d.pop("name", UNSET)
|
86
|
+
|
79
87
|
owner = d.pop("owner", UNSET)
|
80
88
|
|
81
89
|
path = d.pop("path", UNSET)
|
@@ -88,6 +96,7 @@ class FileWithContent:
|
|
88
96
|
content=content,
|
89
97
|
group=group,
|
90
98
|
last_modified=last_modified,
|
99
|
+
name=name,
|
91
100
|
owner=owner,
|
92
101
|
path=path,
|
93
102
|
permissions=permissions,
|
@@ -0,0 +1,78 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="ProcessLogs")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class ProcessLogs:
|
13
|
+
"""
|
14
|
+
Attributes:
|
15
|
+
logs (Union[Unset, str]): Example: logs output.
|
16
|
+
stderr (Union[Unset, str]): Example: stderr output.
|
17
|
+
stdout (Union[Unset, str]): Example: stdout output.
|
18
|
+
"""
|
19
|
+
|
20
|
+
logs: Union[Unset, str] = UNSET
|
21
|
+
stderr: Union[Unset, str] = UNSET
|
22
|
+
stdout: Union[Unset, str] = UNSET
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
24
|
+
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
26
|
+
logs = self.logs
|
27
|
+
|
28
|
+
stderr = self.stderr
|
29
|
+
|
30
|
+
stdout = self.stdout
|
31
|
+
|
32
|
+
field_dict: dict[str, Any] = {}
|
33
|
+
field_dict.update(self.additional_properties)
|
34
|
+
field_dict.update({})
|
35
|
+
if logs is not UNSET:
|
36
|
+
field_dict["logs"] = logs
|
37
|
+
if stderr is not UNSET:
|
38
|
+
field_dict["stderr"] = stderr
|
39
|
+
if stdout is not UNSET:
|
40
|
+
field_dict["stdout"] = stdout
|
41
|
+
|
42
|
+
return field_dict
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
46
|
+
if not src_dict:
|
47
|
+
return None
|
48
|
+
d = src_dict.copy()
|
49
|
+
logs = d.pop("logs", UNSET)
|
50
|
+
|
51
|
+
stderr = d.pop("stderr", UNSET)
|
52
|
+
|
53
|
+
stdout = d.pop("stdout", UNSET)
|
54
|
+
|
55
|
+
process_logs = cls(
|
56
|
+
logs=logs,
|
57
|
+
stderr=stderr,
|
58
|
+
stdout=stdout,
|
59
|
+
)
|
60
|
+
|
61
|
+
process_logs.additional_properties = d
|
62
|
+
return process_logs
|
63
|
+
|
64
|
+
@property
|
65
|
+
def additional_keys(self) -> list[str]:
|
66
|
+
return list(self.additional_properties.keys())
|
67
|
+
|
68
|
+
def __getitem__(self, key: str) -> Any:
|
69
|
+
return self.additional_properties[key]
|
70
|
+
|
71
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
72
|
+
self.additional_properties[key] = value
|
73
|
+
|
74
|
+
def __delitem__(self, key: str) -> None:
|
75
|
+
del self.additional_properties[key]
|
76
|
+
|
77
|
+
def __contains__(self, key: str) -> bool:
|
78
|
+
return key in self.additional_properties
|
@@ -3,6 +3,7 @@ from typing import Any, TypeVar, Union
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
+
from ..models.process_response_status import ProcessResponseStatus
|
6
7
|
from ..types import UNSET, Unset
|
7
8
|
|
8
9
|
T = TypeVar("T", bound="ProcessResponse")
|
@@ -18,7 +19,7 @@ class ProcessResponse:
|
|
18
19
|
name (Union[Unset, str]): Example: my-process.
|
19
20
|
pid (Union[Unset, str]): Example: 1234.
|
20
21
|
started_at (Union[Unset, str]): Example: Wed, 01 Jan 2023 12:00:00 GMT.
|
21
|
-
status (Union[Unset,
|
22
|
+
status (Union[Unset, ProcessResponseStatus]): Example: running.
|
22
23
|
working_dir (Union[Unset, str]): Example: /home/user.
|
23
24
|
"""
|
24
25
|
|
@@ -28,7 +29,7 @@ class ProcessResponse:
|
|
28
29
|
name: Union[Unset, str] = UNSET
|
29
30
|
pid: Union[Unset, str] = UNSET
|
30
31
|
started_at: Union[Unset, str] = UNSET
|
31
|
-
status: Union[Unset,
|
32
|
+
status: Union[Unset, ProcessResponseStatus] = UNSET
|
32
33
|
working_dir: Union[Unset, str] = UNSET
|
33
34
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
34
35
|
|
@@ -45,7 +46,9 @@ class ProcessResponse:
|
|
45
46
|
|
46
47
|
started_at = self.started_at
|
47
48
|
|
48
|
-
status =
|
49
|
+
status: Union[Unset, str] = UNSET
|
50
|
+
if not isinstance(self.status, Unset):
|
51
|
+
status = self.status.value
|
49
52
|
|
50
53
|
working_dir = self.working_dir
|
51
54
|
|
@@ -88,7 +91,12 @@ class ProcessResponse:
|
|
88
91
|
|
89
92
|
started_at = d.pop("startedAt", UNSET)
|
90
93
|
|
91
|
-
|
94
|
+
_status = d.pop("status", UNSET)
|
95
|
+
status: Union[Unset, ProcessResponseStatus]
|
96
|
+
if isinstance(_status, Unset):
|
97
|
+
status = UNSET
|
98
|
+
else:
|
99
|
+
status = ProcessResponseStatus(_status)
|
92
100
|
|
93
101
|
working_dir = d.pop("workingDir", UNSET)
|
94
102
|
|
@@ -12,18 +12,24 @@ T = TypeVar("T", bound="Subdirectory")
|
|
12
12
|
class Subdirectory:
|
13
13
|
"""
|
14
14
|
Attributes:
|
15
|
+
name (Union[Unset, str]):
|
15
16
|
path (Union[Unset, str]):
|
16
17
|
"""
|
17
18
|
|
19
|
+
name: Union[Unset, str] = UNSET
|
18
20
|
path: Union[Unset, str] = UNSET
|
19
21
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
20
22
|
|
21
23
|
def to_dict(self) -> dict[str, Any]:
|
24
|
+
name = self.name
|
25
|
+
|
22
26
|
path = self.path
|
23
27
|
|
24
28
|
field_dict: dict[str, Any] = {}
|
25
29
|
field_dict.update(self.additional_properties)
|
26
30
|
field_dict.update({})
|
31
|
+
if name is not UNSET:
|
32
|
+
field_dict["name"] = name
|
27
33
|
if path is not UNSET:
|
28
34
|
field_dict["path"] = path
|
29
35
|
|
@@ -34,9 +40,12 @@ class Subdirectory:
|
|
34
40
|
if not src_dict:
|
35
41
|
return None
|
36
42
|
d = src_dict.copy()
|
43
|
+
name = d.pop("name", UNSET)
|
44
|
+
|
37
45
|
path = d.pop("path", UNSET)
|
38
46
|
|
39
47
|
subdirectory = cls(
|
48
|
+
name=name,
|
40
49
|
path=path,
|
41
50
|
)
|
42
51
|
|
blaxel/sandbox/preview.py
CHANGED
@@ -1,24 +1,20 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
|
-
from datetime import datetime
|
2
|
+
from datetime import datetime
|
3
3
|
from typing import List, Optional
|
4
4
|
|
5
|
-
from ..client.api.compute.create_sandbox_preview import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
from ..client.api.compute.delete_sandbox_preview import
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
from ..client.api.compute.get_sandbox_preview import
|
14
|
-
|
15
|
-
from ..client.api.compute.
|
16
|
-
asyncio as list_sandbox_preview_tokens
|
17
|
-
from ..client.api.compute.list_sandbox_previews import \
|
18
|
-
asyncio as list_sandbox_previews
|
5
|
+
from ..client.api.compute.create_sandbox_preview import asyncio as create_sandbox_preview
|
6
|
+
from ..client.api.compute.create_sandbox_preview_token import (
|
7
|
+
asyncio as create_sandbox_preview_token,
|
8
|
+
)
|
9
|
+
from ..client.api.compute.delete_sandbox_preview import asyncio as delete_sandbox_preview
|
10
|
+
from ..client.api.compute.delete_sandbox_preview_token import (
|
11
|
+
asyncio as delete_sandbox_preview_token,
|
12
|
+
)
|
13
|
+
from ..client.api.compute.get_sandbox_preview import asyncio as get_sandbox_preview
|
14
|
+
from ..client.api.compute.list_sandbox_preview_tokens import asyncio as list_sandbox_preview_tokens
|
15
|
+
from ..client.api.compute.list_sandbox_previews import asyncio as list_sandbox_previews
|
19
16
|
from ..client.client import client
|
20
|
-
from ..client.models import
|
21
|
-
PreviewTokenSpec, Sandbox)
|
17
|
+
from ..client.models import Preview, PreviewSpec, PreviewToken, PreviewTokenSpec, Sandbox
|
22
18
|
|
23
19
|
|
24
20
|
@dataclass
|
blaxel/sandbox/process.py
CHANGED
@@ -13,12 +13,7 @@ from .client.api.process.get_process_identifier_logs import (
|
|
13
13
|
asyncio_detailed as get_process_by_identifier_logs,
|
14
14
|
)
|
15
15
|
from .client.api.process.post_process import asyncio_detailed as post_process
|
16
|
-
from .client.models import
|
17
|
-
GetProcessIdentifierLogsResponse200,
|
18
|
-
ProcessKillRequest,
|
19
|
-
ProcessResponse,
|
20
|
-
SuccessResponse,
|
21
|
-
)
|
16
|
+
from .client.models import ProcessKillRequest, ProcessLogs, ProcessResponse, SuccessResponse
|
22
17
|
|
23
18
|
|
24
19
|
class SandboxProcess(SandboxHandleBase):
|
@@ -51,7 +46,11 @@ class SandboxProcess(SandboxHandleBase):
|
|
51
46
|
async def logs(self, identifier: str, type_: str = "stdout") -> str:
|
52
47
|
response = await get_process_by_identifier_logs(identifier=identifier, client=self.client)
|
53
48
|
self.handle_response(response)
|
54
|
-
data:
|
55
|
-
if type_
|
56
|
-
return data.
|
49
|
+
data: ProcessLogs = response.parsed
|
50
|
+
if type_ == "all":
|
51
|
+
return data.logs
|
52
|
+
elif type_ == "stderr":
|
53
|
+
return data.stderr
|
54
|
+
elif type_ == "stdout":
|
55
|
+
return data.stdout
|
57
56
|
raise Exception("Unsupported log type")
|
@@ -0,0 +1,169 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: blaxel
|
3
|
+
Version: 0.1.18
|
4
|
+
Summary: Add your description here
|
5
|
+
Project-URL: Homepage, https://blaxel.ai
|
6
|
+
Project-URL: Documentation, https://docs.blaxel.ai
|
7
|
+
Project-URL: Repository, https://github.com/blaxel-ai/sdk-python
|
8
|
+
Project-URL: Changelog, https://docs.blaxel.ai/changelog
|
9
|
+
Author-email: cploujoux <cploujoux@blaxel.ai>
|
10
|
+
License-File: LICENSE
|
11
|
+
Requires-Python: >=3.10
|
12
|
+
Requires-Dist: attrs>=21.3.0
|
13
|
+
Requires-Dist: httpx>=0.27.0
|
14
|
+
Requires-Dist: mcp<=1.7.1
|
15
|
+
Requires-Dist: opentelemetry-api>=1.28.0
|
16
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.28.0
|
17
|
+
Requires-Dist: opentelemetry-instrumentation-anthropic==0.40.6
|
18
|
+
Requires-Dist: opentelemetry-instrumentation-cohere==0.40.6
|
19
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi==0.54b1
|
20
|
+
Requires-Dist: opentelemetry-instrumentation-ollama==0.40.6
|
21
|
+
Requires-Dist: opentelemetry-instrumentation-openai==0.40.6
|
22
|
+
Requires-Dist: opentelemetry-instrumentation-system-metrics
|
23
|
+
Requires-Dist: opentelemetry-sdk>=1.28.0
|
24
|
+
Requires-Dist: pydantic<2.11.0,>=2.10.3
|
25
|
+
Requires-Dist: pyjwt>=2.10.1
|
26
|
+
Requires-Dist: python-dateutil>=2.8.0
|
27
|
+
Requires-Dist: pyyaml<6.1.0,>=6.0.2
|
28
|
+
Requires-Dist: requests<2.33.0,>=2.32.3
|
29
|
+
Requires-Dist: tomli>=2.2.1
|
30
|
+
Requires-Dist: websockets<15.0.0
|
31
|
+
Provides-Extra: crewai
|
32
|
+
Requires-Dist: crewai>=0.120.1; extra == 'crewai'
|
33
|
+
Requires-Dist: opentelemetry-instrumentation-crewai>=0.40.6; extra == 'crewai'
|
34
|
+
Provides-Extra: google-adk
|
35
|
+
Requires-Dist: google-adk>=0.2.0; extra == 'google-adk'
|
36
|
+
Requires-Dist: litellm>=1.63.11; extra == 'google-adk'
|
37
|
+
Provides-Extra: langchain
|
38
|
+
Requires-Dist: langchain-anthropic>=0.3.10; extra == 'langchain'
|
39
|
+
Requires-Dist: langchain-cerebras>=0.5.0; extra == 'langchain'
|
40
|
+
Requires-Dist: langchain-cohere>=0.4.3; extra == 'langchain'
|
41
|
+
Requires-Dist: langchain-community<0.4.0,>=0.3.3; extra == 'langchain'
|
42
|
+
Requires-Dist: langchain-core<0.4.0,>=0.3.13; extra == 'langchain'
|
43
|
+
Requires-Dist: langchain-deepseek-official>=0.1.0.post1; extra == 'langchain'
|
44
|
+
Requires-Dist: langchain-openai>=0.3.10; extra == 'langchain'
|
45
|
+
Requires-Dist: langchain-xai>=0.2.2; extra == 'langchain'
|
46
|
+
Requires-Dist: langgraph<0.3.0,>=0.2.40; extra == 'langchain'
|
47
|
+
Requires-Dist: opentelemetry-instrumentation-langchain>=0.35.0; extra == 'langchain'
|
48
|
+
Requires-Dist: pillow>=10.0.0; extra == 'langchain'
|
49
|
+
Provides-Extra: livekit
|
50
|
+
Requires-Dist: livekit-agents[anthropic,cartesia,deepgram,elevenlabs,groq,openai,silero,turn-detector]~=1.0; extra == 'livekit'
|
51
|
+
Requires-Dist: livekit-plugins-noise-cancellation~=0.2; extra == 'livekit'
|
52
|
+
Provides-Extra: llamaindex
|
53
|
+
Requires-Dist: llama-index-llms-anthropic>=0.6.10; extra == 'llamaindex'
|
54
|
+
Requires-Dist: llama-index-llms-cerebras>=0.2.2; extra == 'llamaindex'
|
55
|
+
Requires-Dist: llama-index-llms-cohere>=0.4.0; extra == 'llamaindex'
|
56
|
+
Requires-Dist: llama-index-llms-deepseek>=0.1.1; extra == 'llamaindex'
|
57
|
+
Requires-Dist: llama-index-llms-google-genai>=0.1.7; extra == 'llamaindex'
|
58
|
+
Requires-Dist: llama-index-llms-groq>=0.3.1; extra == 'llamaindex'
|
59
|
+
Requires-Dist: llama-index-llms-mistralai>=0.4.0; extra == 'llamaindex'
|
60
|
+
Requires-Dist: llama-index-llms-openai>=0.3.28; extra == 'llamaindex'
|
61
|
+
Requires-Dist: llama-index>=0.12.26; extra == 'llamaindex'
|
62
|
+
Requires-Dist: opentelemetry-instrumentation-llamaindex>=0.35.0; extra == 'llamaindex'
|
63
|
+
Provides-Extra: openai-agents
|
64
|
+
Requires-Dist: openai-agents>=0.0.7; extra == 'openai-agents'
|
65
|
+
Provides-Extra: pydantic-ai
|
66
|
+
Requires-Dist: pydantic-ai>=0.0.48; extra == 'pydantic-ai'
|
67
|
+
Description-Content-Type: text/markdown
|
68
|
+
|
69
|
+
# Blaxel Python SDK
|
70
|
+
|
71
|
+
<p align="center">
|
72
|
+
<img src="https://blaxel.ai/logo-bg.png" alt="Blaxel"/>
|
73
|
+
</p>
|
74
|
+
|
75
|
+
**Blaxel is a computing platform for AI agent builders, with all the services and infrastructure to build and deploy agents efficiently.** This repository contains the Python SDK to create and manage resources on Blaxel.
|
76
|
+
|
77
|
+
## Table of Contents
|
78
|
+
|
79
|
+
- [Installation](#installation)
|
80
|
+
- [Authentication](#authentication)
|
81
|
+
- [Features](#features)
|
82
|
+
- [Quickstart](#quickstart)
|
83
|
+
- [Contributing](#contributing)
|
84
|
+
- [License](#license)
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
## Installation
|
89
|
+
|
90
|
+
Install Blaxel SDK which lets you manage Blaxel resources.
|
91
|
+
|
92
|
+
```bash
|
93
|
+
## Using pip
|
94
|
+
pip install blaxel
|
95
|
+
|
96
|
+
## Using uv
|
97
|
+
uv pip install blaxel
|
98
|
+
|
99
|
+
## Using uv add
|
100
|
+
uv add blaxel
|
101
|
+
```
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
### Authentication
|
106
|
+
|
107
|
+
The Blaxel SDK authenticates with your workspace using credentials from these sources, in priority order:
|
108
|
+
1. When running on Blaxel, authentication is handled automatically
|
109
|
+
2. Variables in your .env file (`BL_WORKSPACE` and `BL_API_KEY`, or see [this page](https://docs.blaxel.ai/Agents/Variables-and-secrets) for other authentication options).
|
110
|
+
3. Environment variables from your machine
|
111
|
+
4. Configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
|
112
|
+
|
113
|
+
When developing locally, the recommended method is to just log in to your workspace with Blaxel CLI. This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, this connection persists automatically.
|
114
|
+
|
115
|
+
When running Blaxel SDK from a remote server that is not Blaxel-hosted, we recommend using environment variables as described in the third option above.
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
## Features
|
120
|
+
- Agents & MCP servers
|
121
|
+
- [Create MCP servers](https://docs.blaxel.ai/Functions/Create-MCP-server)
|
122
|
+
- [Connect to MCP servers and model APIs hosted on Blaxel](https://docs.blaxel.ai/Agents/Develop-an-agent-ts)
|
123
|
+
- [Call agents from another agent](https://docs.blaxel.ai/Agents/Develop-an-agent-ts#connect-to-another-agent-multi-agent-chaining)
|
124
|
+
- [Deploy on Blaxel](https://docs.blaxel.ai/Agents/Deploy-an-agent)
|
125
|
+
- Sandboxes
|
126
|
+
- [Create and update sandboxes and sandbox previews](https://docs.blaxel.ai/Sandboxes/Overview)
|
127
|
+
- [Run filesystem operations and processes on a sandbox](https://docs.blaxel.ai/Sandboxes/Processes)
|
128
|
+
- [Use environment variables or secrets](https://docs.blaxel.ai/Agents/Variables-and-secrets)
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
## Quickstart
|
133
|
+
|
134
|
+
Blaxel CLI gives you a quick way to create new applications: agents, MCP servers, jobs, etc - and deploy them to Blaxel.
|
135
|
+
|
136
|
+
**Prerequisites**:
|
137
|
+
- **Node.js:** v18 or later.
|
138
|
+
- **Blaxel CLI:** Make sure you have Blaxel CLI installed. If not, [install it](https://docs.blaxel.ai/cli-reference/introduction):
|
139
|
+
```bash
|
140
|
+
curl -fsSL \
|
141
|
+
https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh \
|
142
|
+
| BINDIR=/usr/local/bin sudo -E sh
|
143
|
+
```
|
144
|
+
- **Blaxel login:** Login to Blaxel:
|
145
|
+
```bash
|
146
|
+
bl login YOUR-WORKSPACE
|
147
|
+
```
|
148
|
+
|
149
|
+
```bash
|
150
|
+
bl create-agent-app myfolder
|
151
|
+
cd myfolder
|
152
|
+
bl deploy
|
153
|
+
```
|
154
|
+
|
155
|
+
Also available:
|
156
|
+
- `bl create-mcp-server`
|
157
|
+
- `bl create-job`
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
## Contributing
|
162
|
+
|
163
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
## License
|
168
|
+
|
169
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|