simplex 2.0.1__tar.gz → 2.0.4__tar.gz

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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplex
3
- Version: 2.0.1
3
+ Version: 2.0.4
4
4
  Summary: Official Python SDK for the Simplex API
5
5
  Author-email: Simplex <support@simplex.sh>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simplex"
7
- version = "2.0.1"
7
+ version = "2.0.4"
8
8
  description = "Official Python SDK for the Simplex API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -35,7 +35,7 @@ from simplex.types import (
35
35
  SessionStatusResponse,
36
36
  )
37
37
 
38
- __version__ = "2.0.1"
38
+ __version__ = "2.0.4"
39
39
  __all__ = [
40
40
  "SimplexClient",
41
41
  "SimplexError",
@@ -21,7 +21,7 @@ from simplex.errors import (
21
21
  ValidationError,
22
22
  )
23
23
 
24
- __version__ = "2.0.1"
24
+ __version__ = "2.0.4"
25
25
 
26
26
 
27
27
  class HttpClient:
@@ -250,31 +250,35 @@ class SimplexClient:
250
250
  session_id=session_id,
251
251
  )
252
252
 
253
- def retrieve_session_logs(self, session_id: str) -> Any:
253
+ def retrieve_session_logs(self, session_id: str) -> Any | None:
254
254
  """
255
- Retrieve the session logs for a completed session.
255
+ Retrieve the session logs for a session.
256
256
 
257
- Downloads the detailed logs of all actions and events that occurred
258
- during the workflow session execution.
257
+ Returns None if the session is still running or shutting down.
258
+ Logs are only available for completed sessions.
259
259
 
260
260
  Args:
261
261
  session_id: ID of the session to retrieve logs for
262
262
 
263
263
  Returns:
264
- Parsed JSON logs containing session events and details
264
+ Parsed JSON logs containing session events and details,
265
+ or None if the session is still running
265
266
 
266
267
  Raises:
267
268
  WorkflowError: If retrieving session logs fails
268
269
 
269
270
  Example:
270
271
  >>> logs = client.retrieve_session_logs("session-123")
271
- >>> for entry in logs:
272
- ... print(f"{entry['timestamp']}: {entry['message']}")
272
+ >>> if logs is None:
273
+ ... print("Session is still running, logs not yet available")
274
+ ... else:
275
+ ... print(f"Got {len(logs)} log entries")
273
276
  """
274
277
  try:
275
278
  content = self._http_client.download_file(f"/retrieve_session_logs/{session_id}")
276
279
  text = content.decode("utf-8")
277
- return json.loads(text)
280
+ response = json.loads(text)
281
+ return response.get("logs")
278
282
  except json.JSONDecodeError as e:
279
283
  raise WorkflowError(
280
284
  f"Failed to parse session logs: {e}",
@@ -26,7 +26,7 @@ class FileMetadata(TypedDict):
26
26
  download_timestamp: str
27
27
 
28
28
 
29
- class SessionStatusResponse(TypedDict):
29
+ class SessionStatusResponse(TypedDict, total=False):
30
30
  """
31
31
  Response from polling session status.
32
32
 
@@ -36,7 +36,9 @@ class SessionStatusResponse(TypedDict):
36
36
  metadata: Custom metadata provided when the session was started
37
37
  workflow_metadata: Metadata from the workflow definition
38
38
  file_metadata: Metadata for files downloaded during the session
39
- scraper_outputs: Scraper outputs collected during the session
39
+ scraper_outputs: Scraper outputs collected during the session, keyed by output name
40
+ paused: Whether the session is currently paused
41
+ paused_key: The pause key if the session is paused
40
42
  """
41
43
 
42
44
  in_progress: bool
@@ -44,7 +46,9 @@ class SessionStatusResponse(TypedDict):
44
46
  metadata: dict[str, Any]
45
47
  workflow_metadata: dict[str, Any]
46
48
  file_metadata: list[FileMetadata]
47
- scraper_outputs: list[Any]
49
+ scraper_outputs: dict[str, Any]
50
+ paused: bool
51
+ paused_key: str
48
52
 
49
53
 
50
54
  class RunWorkflowResponse(TypedDict):
@@ -56,9 +60,11 @@ class RunWorkflowResponse(TypedDict):
56
60
  message: Human-readable status message
57
61
  session_id: Unique identifier for this workflow session
58
62
  vnc_url: URL for VNC access to the workflow session
63
+ logs_url: URL for viewing session logs
59
64
  """
60
65
 
61
66
  succeeded: bool
62
67
  message: str
63
68
  session_id: str
64
69
  vnc_url: str
70
+ logs_url: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplex
3
- Version: 2.0.1
3
+ Version: 2.0.4
4
4
  Summary: Official Python SDK for the Simplex API
5
5
  Author-email: Simplex <support@simplex.sh>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes