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.
- {simplex-2.0.1/simplex.egg-info → simplex-2.0.4}/PKG-INFO +1 -1
- {simplex-2.0.1 → simplex-2.0.4}/pyproject.toml +1 -1
- {simplex-2.0.1 → simplex-2.0.4}/simplex/__init__.py +1 -1
- {simplex-2.0.1 → simplex-2.0.4}/simplex/_http_client.py +1 -1
- {simplex-2.0.1 → simplex-2.0.4}/simplex/client.py +12 -8
- {simplex-2.0.1 → simplex-2.0.4}/simplex/types.py +9 -3
- {simplex-2.0.1 → simplex-2.0.4/simplex.egg-info}/PKG-INFO +1 -1
- {simplex-2.0.1 → simplex-2.0.4}/LICENSE +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/MANIFEST.in +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/README.md +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/requirements.txt +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/setup.cfg +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/simplex/errors.py +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/simplex.egg-info/SOURCES.txt +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/simplex.egg-info/dependency_links.txt +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/simplex.egg-info/requires.txt +0 -0
- {simplex-2.0.1 → simplex-2.0.4}/simplex.egg-info/top_level.txt +0 -0
|
@@ -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
|
|
255
|
+
Retrieve the session logs for a session.
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
>>>
|
|
272
|
-
... print(
|
|
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
|
-
|
|
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:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|