blaxel 0.2.4__py3-none-any.whl → 0.2.6__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.
@@ -7,6 +7,7 @@ from .sandbox import (
7
7
  )
8
8
  from .types import (
9
9
  CopyResponse,
10
+ ProcessRequestWithLog,
10
11
  SandboxConfiguration,
11
12
  SandboxCreateConfiguration,
12
13
  SandboxFilesystemFile,
@@ -28,4 +29,5 @@ __all__ = [
28
29
  "SandboxFileSystem",
29
30
  "SandboxPreviews",
30
31
  "SandboxProcess",
32
+ "ProcessRequestWithLog",
31
33
  ]
@@ -7,7 +7,7 @@ from ..common.settings import settings
7
7
  from .action import SandboxAction
8
8
  from .client.models import ProcessResponse, SuccessResponse
9
9
  from .client.models.process_request import ProcessRequest
10
- from .types import SandboxConfiguration
10
+ from .types import ProcessRequestWithLog, SandboxConfiguration
11
11
 
12
12
 
13
13
  class SandboxProcess(SandboxAction):
@@ -76,11 +76,17 @@ class SandboxProcess(SandboxAction):
76
76
  return {"close": close}
77
77
 
78
78
  async def exec(
79
- self,
80
- process: Union[ProcessRequest, Dict[str, Any]],
81
- on_log: Optional[Callable[[str], None]] = None,
79
+ self, process: Union[ProcessRequest, ProcessRequestWithLog, Dict[str, Any]]
82
80
  ) -> ProcessResponse:
81
+ on_log = None
82
+ if isinstance(process, ProcessRequestWithLog):
83
+ on_log = process.on_log
84
+ process = process.to_dict()
85
+
83
86
  if isinstance(process, dict):
87
+ if "on_log" in process:
88
+ on_log = process["on_log"]
89
+ del process["on_log"]
84
90
  process = ProcessRequest.from_dict(process)
85
91
 
86
92
  # Store original wait_for_completion setting
@@ -1,8 +1,11 @@
1
1
  from datetime import datetime
2
- from typing import Any, Dict, List, Optional, Union
2
+ from typing import Any, Callable, Dict, List, Optional, Union
3
+
4
+ from attrs import define as _attrs_define
3
5
 
4
6
  from ..client.models import Port, Sandbox
5
7
  from ..client.types import UNSET
8
+ from .client.models.process_request import ProcessRequest
6
9
 
7
10
 
8
11
  class SessionCreateOptions:
@@ -164,9 +167,18 @@ class SandboxCreateConfiguration:
164
167
  if isinstance(env, dict):
165
168
  # Validate that the dict has the required keys
166
169
  if "name" not in env or "value" not in env:
167
- raise ValueError(f"Environment variable dict must have 'name' and 'value' keys: {env}")
170
+ raise ValueError(
171
+ f"Environment variable dict must have 'name' and 'value' keys: {env}"
172
+ )
168
173
  env_objects.append({"name": env["name"], "value": env["value"]})
169
174
  else:
170
- raise ValueError(f"Invalid env type: {type(env)}. Expected dict with 'name' and 'value' keys.")
175
+ raise ValueError(
176
+ f"Invalid env type: {type(env)}. Expected dict with 'name' and 'value' keys."
177
+ )
171
178
 
172
179
  return env_objects
180
+
181
+
182
+ @_attrs_define
183
+ class ProcessRequestWithLog(ProcessRequest):
184
+ on_log: Callable[[str], None] = None
@@ -73,7 +73,7 @@ class BlaxelCoreInstrumentor(BaseInstrumentor):
73
73
 
74
74
  async def traced_list_tools(self, *args, **kwargs):
75
75
  span_attributes = {
76
- "tool.server": self.url,
76
+ "tool.server": self._url,
77
77
  "tool.server_name": self.name,
78
78
  "span.type": "tool.list",
79
79
  **SpanManager.get_default_attributes(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blaxel
3
- Version: 0.2.4
3
+ Version: 0.2.6
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
@@ -304,15 +304,15 @@ blaxel/core/mcp/__init__.py,sha256=5VjkiQFb1QWW5QKRgwPHARlxZJ9Xqaz0diJTpM8LLF0,1
304
304
  blaxel/core/mcp/client.py,sha256=aK3wSnsO8DmT1BZqw4eiCMF71Jwvni6Qga0DhPP806Y,5437
305
305
  blaxel/core/mcp/server.py,sha256=tXySGZKgK3IllYOzYOecp58BixKBkmAIvQp_4nSM_Ww,5919
306
306
  blaxel/core/models/__init__.py,sha256=HbRDsMnUFHkPC-MMkzPXh4mUqkVjqO6p3j7m00N_XSo,1722
307
- blaxel/core/sandbox/__init__.py,sha256=oF3sX5MbwSqfwhOtF5ODYWwapHffbkp2UI78jPBn78U,617
307
+ blaxel/core/sandbox/__init__.py,sha256=fyxxdPhVIkI1FwSI4tHG1DH0W4sYuNaWvVxO7_due2U,673
308
308
  blaxel/core/sandbox/action.py,sha256=9Zjkco7YkLzBThD3N2Hr5SpeEiqU_-Ktk8HlKpkpiAg,2802
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=g0uVbMsIi8gRXmmyOfSyqm1qO4Cv6rsq92fs_k884dY,6120
312
- blaxel/core/sandbox/process.py,sha256=7zEngDTs2XiNsMm9TZ4lEDUiRpS3af8dw60pEvRuHDY,8357
312
+ blaxel/core/sandbox/process.py,sha256=g13yig8pvIwHtABFXwxWKSd5K4KYhEQQcGumME9I-GA,8609
313
313
  blaxel/core/sandbox/sandbox.py,sha256=y6mV2-i6TsSZGQsvBBGptR514OfgvhV0hXBMEsOBcsY,8648
314
314
  blaxel/core/sandbox/session.py,sha256=3PfoekfdVzLYttsmKeK3MePhuprjqv_FDyVQTQME0OE,5277
315
- blaxel/core/sandbox/types.py,sha256=nsbvZLUxvDZkg2oExE3HdXx2qIpPaaoa7_lGYBzQ8Xk,5638
315
+ blaxel/core/sandbox/types.py,sha256=E-IjEetAMhFDz-mDizFlifCrXoIeJnkbxolQS3p8TKQ,5936
316
316
  blaxel/core/sandbox/client/__init__.py,sha256=N26bD5o1jsTb48oExow6Rgivd8ylaU9jaWZfZsVilP8,128
317
317
  blaxel/core/sandbox/client/client.py,sha256=tcP8cJ4Q3dV9aB3yQ01dDXO-ekfsa3WGGFz4DQAEf8I,7079
318
318
  blaxel/core/sandbox/client/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
@@ -394,7 +394,7 @@ blaxel/telemetry/exporters.py,sha256=EoX3uaBVku1Rg49pSNXKFyHhgY5OV3Ih6UlqgjF5epw
394
394
  blaxel/telemetry/manager.py,sha256=3yYBxxqQKl1rCKrn0GVz9jR5jouC1nsElbAaH8tTtgA,9075
395
395
  blaxel/telemetry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
396
396
  blaxel/telemetry/span.py,sha256=b8lpWe5nqek4w9YrBLJCIYz4Z3n9Z_49H_AkqpAGOiM,3660
397
- blaxel/telemetry/instrumentation/blaxel_core.py,sha256=7PNseKq7bOQ4Z6a8jW7AGm0ojcdcusjoiH_5iQsR5ic,4881
397
+ blaxel/telemetry/instrumentation/blaxel_core.py,sha256=zQnWu8OBumbIO-GNLqdYGw6Tv-ol9Kkp4nrmZtA0fqk,4882
398
398
  blaxel/telemetry/instrumentation/blaxel_langgraph.py,sha256=sBxt8kzRjsFepm86vaCBbGvpYI4mWPK_PB3wiLxSuOk,4235
399
399
  blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py,sha256=hQbOaaMsHte_Igq_vhPgNXYd40IwuqPB0TUP-5VAtME,11953
400
400
  blaxel/telemetry/instrumentation/blaxel_llamaindex.py,sha256=HA4YUXrRYvG5U1J8MAJnymmmj4ZCDydv-pXXhrftHOA,3101
@@ -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.4.dist-info/METADATA,sha256=oh2nI5vCd2gRNp-9jWiQigKLjSeuVwz7ODk1yny-PMM,9875
406
- blaxel-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
- blaxel-0.2.4.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
- blaxel-0.2.4.dist-info/RECORD,,
405
+ blaxel-0.2.6.dist-info/METADATA,sha256=TgEEH34xxTK_r0dWMh-RWu8NwdCaXWL72lFzllmKgK0,9875
406
+ blaxel-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
407
+ blaxel-0.2.6.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
408
+ blaxel-0.2.6.dist-info/RECORD,,
File without changes