Skip to content

Commit 176f9d3

Browse files
feat(api): Add progress meter to Task Run events
1 parent 8989f91 commit 176f9d3

8 files changed

Lines changed: 61 additions & 37 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-ed59cb6466c038703341e4b1eacb013f08b1907b40a6cba7d39ff5396fb432f3.yml
3-
openapi_spec_hash: 9d983b5f712eb8b5531127543291c6e7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-496d0afc77bafdc8f4208d3ddd767c3101d91ffb933b9b6bfcef5f489cc175a6.yml
3+
openapi_spec_hash: 730e697fec302b9310d4495c1f82802d
44
config_hash: f9aa4d901581aaf70789dd0bc1b84597

src/parallel/resources/beta/task_group.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ def events(
197197
"""
198198
Streams events from a TaskGroup: status updates and run completions.
199199
200-
The connection will remain open for up to 10 minutes as long as at least one run
201-
in the TaskGroup is active.
200+
The connection will remain open for up to an hour as long as at least one run in
201+
the group is still active.
202202
203203
Args:
204204
extra_headers: Send extra headers
@@ -255,6 +255,15 @@ def get_runs(
255255
"""
256256
Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
257257
258+
All runs within a TaskGroup are returned as a stream. To get the inputs and/or
259+
outputs back in the stream, set the corresponding `include_input` and
260+
`include_output` parameters to `true`.
261+
262+
The stream is resumable using the `event_id` as the cursor. To resume a stream,
263+
specify the `last_event_id` parameter with the `event_id` of the last event in
264+
the stream. The stream will resume from the next event after the
265+
`last_event_id`.
266+
258267
Args:
259268
extra_headers: Send extra headers
260269
@@ -453,8 +462,8 @@ async def events(
453462
"""
454463
Streams events from a TaskGroup: status updates and run completions.
455464
456-
The connection will remain open for up to 10 minutes as long as at least one run
457-
in the TaskGroup is active.
465+
The connection will remain open for up to an hour as long as at least one run in
466+
the group is still active.
458467
459468
Args:
460469
extra_headers: Send extra headers
@@ -511,6 +520,15 @@ async def get_runs(
511520
"""
512521
Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
513522
523+
All runs within a TaskGroup are returned as a stream. To get the inputs and/or
524+
outputs back in the stream, set the corresponding `include_input` and
525+
`include_output` parameters to `true`.
526+
527+
The stream is resumable using the `event_id` as the cursor. To resume a stream,
528+
specify the `last_event_id` parameter with the `event_id` of the last event in
529+
the stream. The stream will resume from the next event after the
530+
`last_event_id`.
531+
514532
Args:
515533
extra_headers: Send extra headers
516534

src/parallel/resources/beta/task_run.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ def create(
8787
[Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
8888
false, no progress events are tracked. Note that progress tracking cannot be
8989
enabled after a run has been created. The flag is set to true by default for
90-
premium processors (pro and above). This feature is not available via the Python
91-
SDK. To enable this feature in your API requests, specify the `parallel-beta`
92-
header with `events-sse-2025-07-24` value.
90+
premium processors (pro and above). To enable this feature in your requests,
91+
specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
92+
(for API calls) or `betas` param (for the SDKs).
9393
94-
mcp_servers: Optional list of MCP servers to use for the run. This feature is not available
95-
via the Python SDK. To enable this feature in your API requests, specify the
96-
`parallel-beta` header with `mcp-server-2025-07-17` value.
94+
mcp_servers: Optional list of MCP servers to use for the run. To enable this feature in your
95+
requests, specify `mcp-server-2025-07-17` as one of the values in
96+
`parallel-beta` header (for API calls) or `betas` param (for the SDKs).
9797
9898
metadata: User-provided metadata stored with the run. Keys and values must be strings with
9999
a maximum length of 16 and 512 characters respectively.
@@ -290,13 +290,13 @@ async def create(
290290
[Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
291291
false, no progress events are tracked. Note that progress tracking cannot be
292292
enabled after a run has been created. The flag is set to true by default for
293-
premium processors (pro and above). This feature is not available via the Python
294-
SDK. To enable this feature in your API requests, specify the `parallel-beta`
295-
header with `events-sse-2025-07-24` value.
293+
premium processors (pro and above). To enable this feature in your requests,
294+
specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
295+
(for API calls) or `betas` param (for the SDKs).
296296
297-
mcp_servers: Optional list of MCP servers to use for the run. This feature is not available
298-
via the Python SDK. To enable this feature in your API requests, specify the
299-
`parallel-beta` header with `mcp-server-2025-07-17` value.
297+
mcp_servers: Optional list of MCP servers to use for the run. To enable this feature in your
298+
requests, specify `mcp-server-2025-07-17` as one of the values in
299+
`parallel-beta` header (for API calls) or `betas` param (for the SDKs).
300300
301301
metadata: User-provided metadata stored with the run. Keys and values must be strings with
302302
a maximum length of 16 and 512 characters respectively.

src/parallel/types/beta/beta_run_input.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ class BetaRunInput(BaseModel):
2525
[Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
2626
false, no progress events are tracked. Note that progress tracking cannot be
2727
enabled after a run has been created. The flag is set to true by default for
28-
premium processors (pro and above). This feature is not available via the Python
29-
SDK. To enable this feature in your API requests, specify the `parallel-beta`
30-
header with `events-sse-2025-07-24` value.
28+
premium processors (pro and above). To enable this feature in your requests,
29+
specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
30+
(for API calls) or `betas` param (for the SDKs).
3131
"""
3232

3333
mcp_servers: Optional[List[McpServer]] = None
3434
"""
35-
Optional list of MCP servers to use for the run. This feature is not available
36-
via the Python SDK. To enable this feature in your API requests, specify the
37-
`parallel-beta` header with `mcp-server-2025-07-17` value.
35+
Optional list of MCP servers to use for the run. To enable this feature in your
36+
requests, specify `mcp-server-2025-07-17` as one of the values in
37+
`parallel-beta` header (for API calls) or `betas` param (for the SDKs).
3838
"""
3939

4040
metadata: Optional[Dict[str, Union[str, float, bool]]] = None

src/parallel/types/beta/beta_run_input_param.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ class BetaRunInputParam(TypedDict, total=False):
2727
[Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
2828
false, no progress events are tracked. Note that progress tracking cannot be
2929
enabled after a run has been created. The flag is set to true by default for
30-
premium processors (pro and above). This feature is not available via the Python
31-
SDK. To enable this feature in your API requests, specify the `parallel-beta`
32-
header with `events-sse-2025-07-24` value.
30+
premium processors (pro and above). To enable this feature in your requests,
31+
specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
32+
(for API calls) or `betas` param (for the SDKs).
3333
"""
3434

3535
mcp_servers: Optional[Iterable[McpServerParam]]
3636
"""
37-
Optional list of MCP servers to use for the run. This feature is not available
38-
via the Python SDK. To enable this feature in your API requests, specify the
39-
`parallel-beta` header with `mcp-server-2025-07-17` value.
37+
Optional list of MCP servers to use for the run. To enable this feature in your
38+
requests, specify `mcp-server-2025-07-17` as one of the values in
39+
`parallel-beta` header (for API calls) or `betas` param (for the SDKs).
4040
"""
4141

4242
metadata: Optional[Dict[str, Union[str, float, bool]]]

src/parallel/types/beta/search_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ class SearchResult(BaseModel):
1313
"""A list of WebSearchResult objects, ordered by decreasing relevance."""
1414

1515
search_id: str
16-
"""Search ID. Example: `search_cad0a6d2-dec0-46bd-95ae-900527d880e7`"""
16+
"""Search ID. Example: `search_cad0a6d2dec046bd95ae900527d880e7`"""

src/parallel/types/beta/task_run_create_params.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ class TaskRunCreateParams(TypedDict, total=False):
2929
[Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
3030
false, no progress events are tracked. Note that progress tracking cannot be
3131
enabled after a run has been created. The flag is set to true by default for
32-
premium processors (pro and above). This feature is not available via the Python
33-
SDK. To enable this feature in your API requests, specify the `parallel-beta`
34-
header with `events-sse-2025-07-24` value.
32+
premium processors (pro and above). To enable this feature in your requests,
33+
specify `events-sse-2025-07-24` as one of the values in `parallel-beta` header
34+
(for API calls) or `betas` param (for the SDKs).
3535
"""
3636

3737
mcp_servers: Optional[Iterable[McpServerParam]]
3838
"""
39-
Optional list of MCP servers to use for the run. This feature is not available
40-
via the Python SDK. To enable this feature in your API requests, specify the
41-
`parallel-beta` header with `mcp-server-2025-07-17` value.
39+
Optional list of MCP servers to use for the run. To enable this feature in your
40+
requests, specify `mcp-server-2025-07-17` as one of the values in
41+
`parallel-beta` header (for API calls) or `betas` param (for the SDKs).
4242
"""
4343

4444
metadata: Optional[Dict[str, Union[str, float, bool]]]

src/parallel/types/beta/task_run_events_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class TaskRunProgressStatsEventSourceStats(BaseModel):
2828

2929

3030
class TaskRunProgressStatsEvent(BaseModel):
31+
progress_meter: float
32+
"""Completion percentage of the task run.
33+
34+
Ranges from 0 to 100 where 0 indicates no progress and 100 indicates completion.
35+
"""
36+
3137
source_stats: TaskRunProgressStatsEventSourceStats
3238
"""Source stats for a task run."""
3339

0 commit comments

Comments
 (0)