blaxel 0.2.1rc73__py3-none-any.whl → 0.2.1rc75__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.
@@ -1,10 +1,8 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  if TYPE_CHECKING:
9
7
  from ..models.file import File
10
8
  from ..models.subdirectory import Subdirectory
@@ -17,54 +15,49 @@ T = TypeVar("T", bound="Directory")
17
15
  class Directory:
18
16
  """
19
17
  Attributes:
20
- files (Union[Unset, list['File']]):
21
- name (Union[Unset, str]):
22
- path (Union[Unset, str]):
23
- subdirectories (Union[Unset, list['Subdirectory']]): @name Subdirectories
18
+ files (list['File']):
19
+ name (str):
20
+ path (str):
21
+ subdirectories (list['Subdirectory']): @name Subdirectories
24
22
  """
25
23
 
26
- files: Union[Unset, list["File"]] = UNSET
27
- name: Union[Unset, str] = UNSET
28
- path: Union[Unset, str] = UNSET
29
- subdirectories: Union[Unset, list["Subdirectory"]] = UNSET
24
+ files: list["File"]
25
+ name: str
26
+ path: str
27
+ subdirectories: list["Subdirectory"]
30
28
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
29
 
32
30
  def to_dict(self) -> dict[str, Any]:
33
- files: Union[Unset, list[dict[str, Any]]] = UNSET
34
- if not isinstance(self.files, Unset):
35
- files = []
36
- for files_item_data in self.files:
37
- if type(files_item_data) is dict:
38
- files_item = files_item_data
39
- else:
40
- files_item = files_item_data.to_dict()
41
- files.append(files_item)
31
+ files = []
32
+ for files_item_data in self.files:
33
+ if type(files_item_data) is dict:
34
+ files_item = files_item_data
35
+ else:
36
+ files_item = files_item_data.to_dict()
37
+ files.append(files_item)
42
38
 
43
39
  name = self.name
44
40
 
45
41
  path = self.path
46
42
 
47
- subdirectories: Union[Unset, list[dict[str, Any]]] = UNSET
48
- if not isinstance(self.subdirectories, Unset):
49
- subdirectories = []
50
- for subdirectories_item_data in self.subdirectories:
51
- if type(subdirectories_item_data) is dict:
52
- subdirectories_item = subdirectories_item_data
53
- else:
54
- subdirectories_item = subdirectories_item_data.to_dict()
55
- subdirectories.append(subdirectories_item)
43
+ subdirectories = []
44
+ for subdirectories_item_data in self.subdirectories:
45
+ if type(subdirectories_item_data) is dict:
46
+ subdirectories_item = subdirectories_item_data
47
+ else:
48
+ subdirectories_item = subdirectories_item_data.to_dict()
49
+ subdirectories.append(subdirectories_item)
56
50
 
57
51
  field_dict: dict[str, Any] = {}
58
52
  field_dict.update(self.additional_properties)
59
- field_dict.update({})
60
- if files is not UNSET:
61
- field_dict["files"] = files
62
- if name is not UNSET:
63
- field_dict["name"] = name
64
- if path is not UNSET:
65
- field_dict["path"] = path
66
- if subdirectories is not UNSET:
67
- field_dict["subdirectories"] = subdirectories
53
+ field_dict.update(
54
+ {
55
+ "files": files,
56
+ "name": name,
57
+ "path": path,
58
+ "subdirectories": subdirectories,
59
+ }
60
+ )
68
61
 
69
62
  return field_dict
70
63
 
@@ -77,19 +70,19 @@ class Directory:
77
70
  return None
78
71
  d = src_dict.copy()
79
72
  files = []
80
- _files = d.pop("files", UNSET)
81
- for files_item_data in _files or []:
73
+ _files = d.pop("files")
74
+ for files_item_data in _files:
82
75
  files_item = File.from_dict(files_item_data)
83
76
 
84
77
  files.append(files_item)
85
78
 
86
- name = d.pop("name", UNSET)
79
+ name = d.pop("name")
87
80
 
88
- path = d.pop("path", UNSET)
81
+ path = d.pop("path")
89
82
 
90
83
  subdirectories = []
91
- _subdirectories = d.pop("subdirectories", UNSET)
92
- for subdirectories_item_data in _subdirectories or []:
84
+ _subdirectories = d.pop("subdirectories")
85
+ for subdirectories_item_data in _subdirectories:
93
86
  subdirectories_item = Subdirectory.from_dict(subdirectories_item_data)
94
87
 
95
88
  subdirectories.append(subdirectories_item)
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="ErrorResponse")
9
7
 
10
8
 
@@ -12,10 +10,10 @@ T = TypeVar("T", bound="ErrorResponse")
12
10
  class ErrorResponse:
13
11
  """
14
12
  Attributes:
15
- error (Union[Unset, str]): Example: Error message.
13
+ error (str): Example: Error message.
16
14
  """
17
15
 
18
- error: Union[Unset, str] = UNSET
16
+ error: str
19
17
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
20
18
 
21
19
  def to_dict(self) -> dict[str, Any]:
@@ -23,9 +21,11 @@ class ErrorResponse:
23
21
 
24
22
  field_dict: dict[str, Any] = {}
25
23
  field_dict.update(self.additional_properties)
26
- field_dict.update({})
27
- if error is not UNSET:
28
- field_dict["error"] = error
24
+ field_dict.update(
25
+ {
26
+ "error": error,
27
+ }
28
+ )
29
29
 
30
30
  return field_dict
31
31
 
@@ -34,7 +34,7 @@ class ErrorResponse:
34
34
  if not src_dict:
35
35
  return None
36
36
  d = src_dict.copy()
37
- error = d.pop("error", UNSET)
37
+ error = d.pop("error")
38
38
 
39
39
  error_response = cls(
40
40
  error=error,
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="File")
9
7
 
10
8
 
@@ -12,22 +10,22 @@ T = TypeVar("T", bound="File")
12
10
  class File:
13
11
  """
14
12
  Attributes:
15
- group (Union[Unset, str]):
16
- last_modified (Union[Unset, str]):
17
- name (Union[Unset, str]):
18
- owner (Union[Unset, str]):
19
- path (Union[Unset, str]):
20
- permissions (Union[Unset, str]):
21
- size (Union[Unset, int]):
13
+ group (str):
14
+ last_modified (str):
15
+ name (str):
16
+ owner (str):
17
+ path (str):
18
+ permissions (str):
19
+ size (int):
22
20
  """
23
21
 
24
- group: Union[Unset, str] = UNSET
25
- last_modified: Union[Unset, str] = UNSET
26
- name: Union[Unset, str] = UNSET
27
- owner: Union[Unset, str] = UNSET
28
- path: Union[Unset, str] = UNSET
29
- permissions: Union[Unset, str] = UNSET
30
- size: Union[Unset, int] = UNSET
22
+ group: str
23
+ last_modified: str
24
+ name: str
25
+ owner: str
26
+ path: str
27
+ permissions: str
28
+ size: int
31
29
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
32
30
 
33
31
  def to_dict(self) -> dict[str, Any]:
@@ -47,21 +45,17 @@ class File:
47
45
 
48
46
  field_dict: dict[str, Any] = {}
49
47
  field_dict.update(self.additional_properties)
50
- field_dict.update({})
51
- if group is not UNSET:
52
- field_dict["group"] = group
53
- if last_modified is not UNSET:
54
- field_dict["lastModified"] = last_modified
55
- if name is not UNSET:
56
- field_dict["name"] = name
57
- if owner is not UNSET:
58
- field_dict["owner"] = owner
59
- if path is not UNSET:
60
- field_dict["path"] = path
61
- if permissions is not UNSET:
62
- field_dict["permissions"] = permissions
63
- if size is not UNSET:
64
- field_dict["size"] = size
48
+ field_dict.update(
49
+ {
50
+ "group": group,
51
+ "lastModified": last_modified,
52
+ "name": name,
53
+ "owner": owner,
54
+ "path": path,
55
+ "permissions": permissions,
56
+ "size": size,
57
+ }
58
+ )
65
59
 
66
60
  return field_dict
67
61
 
@@ -70,19 +64,19 @@ class File:
70
64
  if not src_dict:
71
65
  return None
72
66
  d = src_dict.copy()
73
- group = d.pop("group", UNSET)
67
+ group = d.pop("group")
74
68
 
75
- last_modified = d.pop("lastModified", UNSET)
69
+ last_modified = d.pop("lastModified")
76
70
 
77
- name = d.pop("name", UNSET)
71
+ name = d.pop("name")
78
72
 
79
- owner = d.pop("owner", UNSET)
73
+ owner = d.pop("owner")
80
74
 
81
- path = d.pop("path", UNSET)
75
+ path = d.pop("path")
82
76
 
83
- permissions = d.pop("permissions", UNSET)
77
+ permissions = d.pop("permissions")
84
78
 
85
- size = d.pop("size", UNSET)
79
+ size = d.pop("size")
86
80
 
87
81
  file = cls(
88
82
  group=group,
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="FileWithContent")
9
7
 
10
8
 
@@ -12,24 +10,24 @@ T = TypeVar("T", bound="FileWithContent")
12
10
  class FileWithContent:
13
11
  """
14
12
  Attributes:
15
- content (Union[Unset, str]):
16
- group (Union[Unset, str]):
17
- last_modified (Union[Unset, str]):
18
- name (Union[Unset, str]):
19
- owner (Union[Unset, str]):
20
- path (Union[Unset, str]):
21
- permissions (Union[Unset, str]):
22
- size (Union[Unset, int]):
13
+ content (str):
14
+ group (str):
15
+ last_modified (str):
16
+ name (str):
17
+ owner (str):
18
+ path (str):
19
+ permissions (str):
20
+ size (int):
23
21
  """
24
22
 
25
- content: Union[Unset, str] = UNSET
26
- group: Union[Unset, str] = UNSET
27
- last_modified: Union[Unset, str] = UNSET
28
- name: Union[Unset, str] = UNSET
29
- owner: Union[Unset, str] = UNSET
30
- path: Union[Unset, str] = UNSET
31
- permissions: Union[Unset, str] = UNSET
32
- size: Union[Unset, int] = UNSET
23
+ content: str
24
+ group: str
25
+ last_modified: str
26
+ name: str
27
+ owner: str
28
+ path: str
29
+ permissions: str
30
+ size: int
33
31
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
32
 
35
33
  def to_dict(self) -> dict[str, Any]:
@@ -51,23 +49,18 @@ class FileWithContent:
51
49
 
52
50
  field_dict: dict[str, Any] = {}
53
51
  field_dict.update(self.additional_properties)
54
- field_dict.update({})
55
- if content is not UNSET:
56
- field_dict["content"] = content
57
- if group is not UNSET:
58
- field_dict["group"] = group
59
- if last_modified is not UNSET:
60
- field_dict["lastModified"] = last_modified
61
- if name is not UNSET:
62
- field_dict["name"] = name
63
- if owner is not UNSET:
64
- field_dict["owner"] = owner
65
- if path is not UNSET:
66
- field_dict["path"] = path
67
- if permissions is not UNSET:
68
- field_dict["permissions"] = permissions
69
- if size is not UNSET:
70
- field_dict["size"] = size
52
+ field_dict.update(
53
+ {
54
+ "content": content,
55
+ "group": group,
56
+ "lastModified": last_modified,
57
+ "name": name,
58
+ "owner": owner,
59
+ "path": path,
60
+ "permissions": permissions,
61
+ "size": size,
62
+ }
63
+ )
71
64
 
72
65
  return field_dict
73
66
 
@@ -76,21 +69,21 @@ class FileWithContent:
76
69
  if not src_dict:
77
70
  return None
78
71
  d = src_dict.copy()
79
- content = d.pop("content", UNSET)
72
+ content = d.pop("content")
80
73
 
81
- group = d.pop("group", UNSET)
74
+ group = d.pop("group")
82
75
 
83
- last_modified = d.pop("lastModified", UNSET)
76
+ last_modified = d.pop("lastModified")
84
77
 
85
- name = d.pop("name", UNSET)
78
+ name = d.pop("name")
86
79
 
87
- owner = d.pop("owner", UNSET)
80
+ owner = d.pop("owner")
88
81
 
89
- path = d.pop("path", UNSET)
82
+ path = d.pop("path")
90
83
 
91
- permissions = d.pop("permissions", UNSET)
84
+ permissions = d.pop("permissions")
92
85
 
93
- size = d.pop("size", UNSET)
86
+ size = d.pop("size")
94
87
 
95
88
  file_with_content = cls(
96
89
  content=content,
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="ProcessLogs")
9
7
 
10
8
 
@@ -12,14 +10,14 @@ T = TypeVar("T", bound="ProcessLogs")
12
10
  class ProcessLogs:
13
11
  """
14
12
  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.
13
+ logs (str): Example: logs output.
14
+ stderr (str): Example: stderr output.
15
+ stdout (str): Example: stdout output.
18
16
  """
19
17
 
20
- logs: Union[Unset, str] = UNSET
21
- stderr: Union[Unset, str] = UNSET
22
- stdout: Union[Unset, str] = UNSET
18
+ logs: str
19
+ stderr: str
20
+ stdout: str
23
21
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
24
22
 
25
23
  def to_dict(self) -> dict[str, Any]:
@@ -31,13 +29,13 @@ class ProcessLogs:
31
29
 
32
30
  field_dict: dict[str, Any] = {}
33
31
  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
32
+ field_dict.update(
33
+ {
34
+ "logs": logs,
35
+ "stderr": stderr,
36
+ "stdout": stdout,
37
+ }
38
+ )
41
39
 
42
40
  return field_dict
43
41
 
@@ -46,11 +44,11 @@ class ProcessLogs:
46
44
  if not src_dict:
47
45
  return None
48
46
  d = src_dict.copy()
49
- logs = d.pop("logs", UNSET)
47
+ logs = d.pop("logs")
50
48
 
51
- stderr = d.pop("stderr", UNSET)
49
+ stderr = d.pop("stderr")
52
50
 
53
- stdout = d.pop("stdout", UNSET)
51
+ stdout = d.pop("stdout")
54
52
 
55
53
  process_logs = cls(
56
54
  logs=logs,
@@ -1,10 +1,9 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
6
  from ..models.process_response_status import ProcessResponseStatus
7
- from ..types import UNSET, Unset
8
7
 
9
8
  T = TypeVar("T", bound="ProcessResponse")
10
9
 
@@ -13,24 +12,26 @@ T = TypeVar("T", bound="ProcessResponse")
13
12
  class ProcessResponse:
14
13
  """
15
14
  Attributes:
16
- command (Union[Unset, str]): Example: ls -la.
17
- completed_at (Union[Unset, str]): Example: Wed, 01 Jan 2023 12:01:00 GMT.
18
- exit_code (Union[Unset, int]):
19
- name (Union[Unset, str]): Example: my-process.
20
- pid (Union[Unset, str]): Example: 1234.
21
- started_at (Union[Unset, str]): Example: Wed, 01 Jan 2023 12:00:00 GMT.
22
- status (Union[Unset, ProcessResponseStatus]): Example: running.
23
- working_dir (Union[Unset, str]): Example: /home/user.
15
+ command (str): Example: ls -la.
16
+ completed_at (str): Example: Wed, 01 Jan 2023 12:01:00 GMT.
17
+ exit_code (int):
18
+ logs (str): Example: logs output.
19
+ name (str): Example: my-process.
20
+ pid (str): Example: 1234.
21
+ started_at (str): Example: Wed, 01 Jan 2023 12:00:00 GMT.
22
+ status (ProcessResponseStatus): Example: running.
23
+ working_dir (str): Example: /home/user.
24
24
  """
25
25
 
26
- command: Union[Unset, str] = UNSET
27
- completed_at: Union[Unset, str] = UNSET
28
- exit_code: Union[Unset, int] = UNSET
29
- name: Union[Unset, str] = UNSET
30
- pid: Union[Unset, str] = UNSET
31
- started_at: Union[Unset, str] = UNSET
32
- status: Union[Unset, ProcessResponseStatus] = UNSET
33
- working_dir: Union[Unset, str] = UNSET
26
+ command: str
27
+ completed_at: str
28
+ exit_code: int
29
+ logs: str
30
+ name: str
31
+ pid: str
32
+ started_at: str
33
+ status: ProcessResponseStatus
34
+ working_dir: str
34
35
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
36
 
36
37
  def to_dict(self) -> dict[str, Any]:
@@ -40,37 +41,33 @@ class ProcessResponse:
40
41
 
41
42
  exit_code = self.exit_code
42
43
 
44
+ logs = self.logs
45
+
43
46
  name = self.name
44
47
 
45
48
  pid = self.pid
46
49
 
47
50
  started_at = self.started_at
48
51
 
49
- status: Union[Unset, str] = UNSET
50
- if not isinstance(self.status, Unset):
51
- status = self.status.value
52
+ status = self.status.value
52
53
 
53
54
  working_dir = self.working_dir
54
55
 
55
56
  field_dict: dict[str, Any] = {}
56
57
  field_dict.update(self.additional_properties)
57
- field_dict.update({})
58
- if command is not UNSET:
59
- field_dict["command"] = command
60
- if completed_at is not UNSET:
61
- field_dict["completedAt"] = completed_at
62
- if exit_code is not UNSET:
63
- field_dict["exitCode"] = exit_code
64
- if name is not UNSET:
65
- field_dict["name"] = name
66
- if pid is not UNSET:
67
- field_dict["pid"] = pid
68
- if started_at is not UNSET:
69
- field_dict["startedAt"] = started_at
70
- if status is not UNSET:
71
- field_dict["status"] = status
72
- if working_dir is not UNSET:
73
- field_dict["workingDir"] = working_dir
58
+ field_dict.update(
59
+ {
60
+ "command": command,
61
+ "completedAt": completed_at,
62
+ "exitCode": exit_code,
63
+ "logs": logs,
64
+ "name": name,
65
+ "pid": pid,
66
+ "startedAt": started_at,
67
+ "status": status,
68
+ "workingDir": working_dir,
69
+ }
70
+ )
74
71
 
75
72
  return field_dict
76
73
 
@@ -79,31 +76,29 @@ class ProcessResponse:
79
76
  if not src_dict:
80
77
  return None
81
78
  d = src_dict.copy()
82
- command = d.pop("command", UNSET)
79
+ command = d.pop("command")
80
+
81
+ completed_at = d.pop("completedAt")
83
82
 
84
- completed_at = d.pop("completedAt", UNSET)
83
+ exit_code = d.pop("exitCode")
85
84
 
86
- exit_code = d.pop("exitCode", UNSET)
85
+ logs = d.pop("logs")
87
86
 
88
- name = d.pop("name", UNSET)
87
+ name = d.pop("name")
89
88
 
90
- pid = d.pop("pid", UNSET)
89
+ pid = d.pop("pid")
91
90
 
92
- started_at = d.pop("startedAt", UNSET)
91
+ started_at = d.pop("startedAt")
93
92
 
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)
93
+ status = ProcessResponseStatus(d.pop("status"))
100
94
 
101
- working_dir = d.pop("workingDir", UNSET)
95
+ working_dir = d.pop("workingDir")
102
96
 
103
97
  process_response = cls(
104
98
  command=command,
105
99
  completed_at=completed_at,
106
100
  exit_code=exit_code,
101
+ logs=logs,
107
102
  name=name,
108
103
  pid=pid,
109
104
  started_at=started_at,
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="Subdirectory")
9
7
 
10
8
 
@@ -12,12 +10,12 @@ T = TypeVar("T", bound="Subdirectory")
12
10
  class Subdirectory:
13
11
  """
14
12
  Attributes:
15
- name (Union[Unset, str]):
16
- path (Union[Unset, str]):
13
+ name (str):
14
+ path (str):
17
15
  """
18
16
 
19
- name: Union[Unset, str] = UNSET
20
- path: Union[Unset, str] = UNSET
17
+ name: str
18
+ path: str
21
19
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
20
 
23
21
  def to_dict(self) -> dict[str, Any]:
@@ -27,11 +25,12 @@ class Subdirectory:
27
25
 
28
26
  field_dict: dict[str, Any] = {}
29
27
  field_dict.update(self.additional_properties)
30
- field_dict.update({})
31
- if name is not UNSET:
32
- field_dict["name"] = name
33
- if path is not UNSET:
34
- field_dict["path"] = path
28
+ field_dict.update(
29
+ {
30
+ "name": name,
31
+ "path": path,
32
+ }
33
+ )
35
34
 
36
35
  return field_dict
37
36
 
@@ -40,9 +39,9 @@ class Subdirectory:
40
39
  if not src_dict:
41
40
  return None
42
41
  d = src_dict.copy()
43
- name = d.pop("name", UNSET)
42
+ name = d.pop("name")
44
43
 
45
- path = d.pop("path", UNSET)
44
+ path = d.pop("path")
46
45
 
47
46
  subdirectory = cls(
48
47
  name=name,
@@ -1,10 +1,8 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="SuccessResponse")
9
7
 
10
8
 
@@ -12,12 +10,12 @@ T = TypeVar("T", bound="SuccessResponse")
12
10
  class SuccessResponse:
13
11
  """
14
12
  Attributes:
15
- message (Union[Unset, str]): Example: File created successfully.
16
- path (Union[Unset, str]): Example: /path/to/file.
13
+ message (str): Example: File created successfully.
14
+ path (str): Example: /path/to/file.
17
15
  """
18
16
 
19
- message: Union[Unset, str] = UNSET
20
- path: Union[Unset, str] = UNSET
17
+ message: str
18
+ path: str
21
19
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
20
 
23
21
  def to_dict(self) -> dict[str, Any]:
@@ -27,11 +25,12 @@ class SuccessResponse:
27
25
 
28
26
  field_dict: dict[str, Any] = {}
29
27
  field_dict.update(self.additional_properties)
30
- field_dict.update({})
31
- if message is not UNSET:
32
- field_dict["message"] = message
33
- if path is not UNSET:
34
- field_dict["path"] = path
28
+ field_dict.update(
29
+ {
30
+ "message": message,
31
+ "path": path,
32
+ }
33
+ )
35
34
 
36
35
  return field_dict
37
36
 
@@ -40,9 +39,9 @@ class SuccessResponse:
40
39
  if not src_dict:
41
40
  return None
42
41
  d = src_dict.copy()
43
- message = d.pop("message", UNSET)
42
+ message = d.pop("message")
44
43
 
45
- path = d.pop("path", UNSET)
44
+ path = d.pop("path")
46
45
 
47
46
  success_response = cls(
48
47
  message=message,
@@ -10,21 +10,6 @@ from .client.models.process_request import ProcessRequest
10
10
  from .types import SandboxConfiguration
11
11
 
12
12
 
13
- class ProcessResponseWithLogs(ProcessResponse):
14
- """Extended ProcessResponse that adds a logs property."""
15
-
16
- logs: Optional[str] = None
17
-
18
- @classmethod
19
- def from_process_response(cls, process_response: ProcessResponse, logs: Optional[str] = None):
20
- """Create ProcessResponseWithLogs from an existing ProcessResponse."""
21
- # Create a new instance from the dict representation
22
- instance = cls.from_dict(process_response.to_dict())
23
- # Add the logs
24
- instance.logs = logs
25
- return instance
26
-
27
-
28
13
  class SandboxProcess(SandboxAction):
29
14
  def __init__(self, sandbox_config: SandboxConfiguration):
30
15
  super().__init__(sandbox_config)
@@ -94,13 +79,19 @@ class SandboxProcess(SandboxAction):
94
79
  self,
95
80
  process: Union[ProcessRequest, Dict[str, Any]],
96
81
  on_log: Optional[Callable[[str], None]] = None,
97
- ) -> ProcessResponseWithLogs:
82
+ ) -> ProcessResponse:
98
83
  if isinstance(process, dict):
99
84
  process = ProcessRequest.from_dict(process)
100
85
 
86
+ # Store original wait_for_completion setting
87
+ should_wait_for_completion = process.wait_for_completion
88
+
89
+ # Always start process without wait_for_completion to avoid server-side blocking
90
+ if should_wait_for_completion and on_log is not None:
91
+ process.wait_for_completion = False
92
+
101
93
  async with self.get_client() as client_instance:
102
94
  response = await client_instance.post("/process", json=process.to_dict())
103
-
104
95
  # Parse JSON response only once, with better error handling
105
96
  response_data = None
106
97
  if response.content:
@@ -114,32 +105,24 @@ class SandboxProcess(SandboxAction):
114
105
  self.handle_response_error(response, response_data, None)
115
106
  result = ProcessResponse.from_dict(response_data)
116
107
 
117
- # Setup log streaming if on_log is provided
118
- stream_control = None
119
- if on_log is not None:
120
- stream_control = self.stream_logs(result.pid, {"on_log": on_log})
121
-
122
- # Wait for completion if requested
123
- logs = None
124
- if process.wait_for_completion:
108
+ # Handle wait_for_completion with parallel log streaming
109
+ if should_wait_for_completion:
110
+ stream_control = None
111
+ if on_log is not None:
112
+ stream_control = self.stream_logs(result.pid, {"on_log": on_log})
125
113
  try:
126
- # Wait for process to complete
127
- result = await self.wait(result.pid)
128
-
129
- # Get the logs
130
- logs = await self.logs(result.pid, "all")
131
- except Exception as e:
132
- # If waiting fails, still try to return what we have
114
+ # Wait for process completion
115
+ result = await self.wait(result.pid, interval=50)
116
+ finally:
117
+ # Clean up log streaming
133
118
  if stream_control:
134
119
  stream_control["close"]()
135
- raise e
136
-
137
- # Close stream if it was opened and we're done
138
- if stream_control and process.wait_for_completion:
139
- stream_control["close"]()
140
-
141
- # Return wrapped response with logs
142
- return ProcessResponseWithLogs.from_process_response(result, logs)
120
+ else:
121
+ # For non-blocking execution, set up log streaming immediately if requested
122
+ if on_log is not None:
123
+ stream = self.stream_logs(result.pid, {"on_log": on_log})
124
+ result.additional_properties["close"] = stream["close"]
125
+ return result
143
126
 
144
127
  async def wait(
145
128
  self, identifier: str, max_wait: int = 60000, interval: int = 1000
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blaxel
3
- Version: 0.2.1rc73
3
+ Version: 0.2.1rc75
4
4
  Summary: Blaxel - AI development platform SDK
5
5
  Project-URL: Homepage, https://blaxel.ai
6
6
  Project-URL: Documentation, https://docs.blaxel.ai
@@ -309,7 +309,7 @@ blaxel/core/sandbox/action.py,sha256=9Zjkco7YkLzBThD3N2Hr5SpeEiqU_-Ktk8HlKpkpiAg
309
309
  blaxel/core/sandbox/filesystem.py,sha256=dyIvDdlPZO0ijD6mXXX8Yl0t75VijQ6_uMz_9rJd-_4,11317
310
310
  blaxel/core/sandbox/network.py,sha256=P5jLd4AAg1zgyIK4qGWvZaDZ5BzIcxRx2ffz_JLsLMI,357
311
311
  blaxel/core/sandbox/preview.py,sha256=M6FulOxPghUBpb5fLxu1Rd3ekLeCbZ_dgt4s1X2Cneo,5354
312
- blaxel/core/sandbox/process.py,sha256=jgOPL5yLzhd98CLO7nBUABIAPFK5S5z34h6L_TyXsuU,8753
312
+ blaxel/core/sandbox/process.py,sha256=7zEngDTs2XiNsMm9TZ4lEDUiRpS3af8dw60pEvRuHDY,8357
313
313
  blaxel/core/sandbox/sandbox.py,sha256=tsRGvkb2dnGM5pmOiIxWvOmT42P9BDXWtW3h6_CIffI,5802
314
314
  blaxel/core/sandbox/session.py,sha256=4SH1tyXcQ9UqJx4lMwxAlp7x9Te_anDrdSEG6AlNkvU,4496
315
315
  blaxel/core/sandbox/types.py,sha256=gmNAt8x7PrJZHpw2_2aWWDE5uG6H-uEgdIKTYIw4G0g,2981
@@ -340,21 +340,21 @@ blaxel/core/sandbox/client/api/process/get_ws_process_identifier_logs_stream.py,
340
340
  blaxel/core/sandbox/client/api/process/post_process.py,sha256=CgA1Q0vLAfeOT5nMd2ESrO8d6_0kGsrcBs1LSEVZrjo,4656
341
341
  blaxel/core/sandbox/client/models/__init__.py,sha256=eOax5cMg8O7Skpi0vApItrajTY0gx-wRHVe3YC5wBt8,1356
342
342
  blaxel/core/sandbox/client/models/delete_network_process_pid_monitor_response_200.py,sha256=9cQgKDjG98sMridjXKgeR2oZzFKcQ0G9QIojhwYFosI,1376
343
- blaxel/core/sandbox/client/models/directory.py,sha256=TlL3WlWhtdfuaqw4dzNVqnyPcApmwlOoImW25tgvIvg,3821
344
- blaxel/core/sandbox/client/models/error_response.py,sha256=lI15zKBoD2X9yHzSiEaYGUn5TPTxWM7j1Tu5crtd23M,1581
345
- blaxel/core/sandbox/client/models/file.py,sha256=LXjXjnY2p3frh5utiptpVNQGlRSh3gCKhmDxlHAIN6w,3037
343
+ blaxel/core/sandbox/client/models/directory.py,sha256=Cufag2aJuBHXfxDnfiXL4oEiQE5GSb5FWH7Tu_hOhtc,3186
344
+ blaxel/core/sandbox/client/models/error_response.py,sha256=4UZjR8ej0uFPl4CmkMplYebqS3U9EDodqNBltQtGvxI,1493
345
+ blaxel/core/sandbox/client/models/file.py,sha256=MkYNSh9Rj1Gt0txfBeFEcEVg1Z-Z1Tbp31nv3C_WZaA,2446
346
346
  blaxel/core/sandbox/client/models/file_request.py,sha256=xOZSru-fae-En-_2YBgkHa_6iGbqbJsG3RLqBuajVY0,2227
347
- blaxel/core/sandbox/client/models/file_with_content.py,sha256=55vccuRO-n613Ej7W5DXAd7cifHqOUeSSSD27Vf7RP8,3355
347
+ blaxel/core/sandbox/client/models/file_with_content.py,sha256=iDMYClAJBJK-l1Kr0yKuNoiHNG3zJVt44XLsE1ax3IA,2680
348
348
  blaxel/core/sandbox/client/models/get_network_process_pid_ports_response_200.py,sha256=x4uv80kK0GVroWO98l5sE84a6uwZ8pnUKTpGg81ipWA,1351
349
349
  blaxel/core/sandbox/client/models/port_monitor_request.py,sha256=LK7sjAK1TF1ojgG4vGytaKLVtV6-SNXxfZ3sxew1cRE,1698
350
350
  blaxel/core/sandbox/client/models/post_network_process_pid_monitor_response_200.py,sha256=Y8BvNGKU8SlzTGqhaQZk_WWIrmFpNU0LVcmLFjNvqhA,1366
351
- blaxel/core/sandbox/client/models/process_logs.py,sha256=2yMnJcEDBFX3nWqv-msVqGXLMQ_pfIJF-UVdO03a0DY,2100
351
+ blaxel/core/sandbox/client/models/process_logs.py,sha256=WVBgPsvUzPlBIuJzahGor-mXq7RF4qXhi5e9XcUPyOM,1847
352
352
  blaxel/core/sandbox/client/models/process_request.py,sha256=b5WoVKQtKibRw1a1xN6nv7Gj4wiAWGPL_Kj9WmjGKsE,4134
353
353
  blaxel/core/sandbox/client/models/process_request_env.py,sha256=hzVPY4mk4g4bKj_S3uXRyaXvp1V6WB2hlQM0XhB7Xgw,1294
354
- blaxel/core/sandbox/client/models/process_response.py,sha256=13UN4aTg0OZJnABCD-bzsHNzVRqkeJtsuqDaK0DsyBI,4011
354
+ blaxel/core/sandbox/client/models/process_response.py,sha256=vXHK6NBnuf0KYVzpkaApC29KOKwDE-7jBxy_WszApXs,3239
355
355
  blaxel/core/sandbox/client/models/process_response_status.py,sha256=hCE1gCtheV83T6PYURG3k-rPZSauvyTFhsxLEtudgYE,246
356
- blaxel/core/sandbox/client/models/subdirectory.py,sha256=j1ORkqO74vAdPQ-oUMer85P8Gb2mAwky3P2gBCnqyGQ,1761
357
- blaxel/core/sandbox/client/models/success_response.py,sha256=JQbCUIdVJy_TJ3mp8IuvCGbKgCm_iZQMMrqn8uZkxCk,1874
356
+ blaxel/core/sandbox/client/models/subdirectory.py,sha256=obztIgi_XjT4pPoT1-dyOX6O8k0e4ERZUTiI9qgkhJM,1593
357
+ blaxel/core/sandbox/client/models/success_response.py,sha256=ksioQ0qNV7yhXlySY3_3EycsJ1ec7LSxBMwIq4HnfVQ,1703
358
358
  blaxel/core/tools/__init__.py,sha256=9_pgKEU5GbPfqfGN4aZTkthnaV4AVYf63jIZw44peBQ,10167
359
359
  blaxel/core/tools/common.py,sha256=JGK052v_fvwWBFYnIArlBnFFViYyFrqdDn3gdVf53EU,1332
360
360
  blaxel/core/tools/types.py,sha256=YPCGJ4vZDhqR0X2H_TWtc5chQScsC32nGTQdRKJlO8Y,707
@@ -402,7 +402,7 @@ blaxel/telemetry/instrumentation/map.py,sha256=PCzZJj39yiYVYJrxLBNP-NW-tjjYyTijw
402
402
  blaxel/telemetry/instrumentation/utils.py,sha256=KInMYZH-mu9_wvetmf0EmgrfN3Sw8IWk2Y95v2u90_U,1901
403
403
  blaxel/telemetry/log/log.py,sha256=RvQByRjZMoP_dRaAZu8oK6DTegsHs-xV4W-UIqis6CA,2461
404
404
  blaxel/telemetry/log/logger.py,sha256=NPAS3g82ryROjvc_DEZaTIfrcehoLEZoP-JkLxADxc0,4113
405
- blaxel-0.2.1rc73.dist-info/METADATA,sha256=7M9mgqu97Tyk403KOchTBU9BzUlFHr8VXZ6JkuC0riM,9879
406
- blaxel-0.2.1rc73.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
- blaxel-0.2.1rc73.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
- blaxel-0.2.1rc73.dist-info/RECORD,,
405
+ blaxel-0.2.1rc75.dist-info/METADATA,sha256=y5tYQNgSQuYwy1K_GYhy_h_oxz5iKupOB3-U_zVRN9I,9879
406
+ blaxel-0.2.1rc75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
+ blaxel-0.2.1rc75.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
+ blaxel-0.2.1rc75.dist-info/RECORD,,