Skip to content

Commit 198e317

Browse files
feat(api): Task Groups v1 added to SDK
1 parent a6ddb71 commit 198e317

26 files changed

Lines changed: 1705 additions & 202 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 24
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web/parallel-sdk-66ee13c3475d2c76f0956f258f0469903155b83ef02e839641be94cdc2014cf3.yml
3-
openapi_spec_hash: 88af7b88725bead1f8ccdcaeb436fadb
4-
config_hash: e17d82e9cb35004e5f9a9d3c4cf51aeb
1+
configured_endpoints: 29
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web/parallel-sdk-50b96a0c200c4be7554264406265a45af334f5e61ec30554fd9ef0fe0d63de92.yml
3+
openapi_spec_hash: a46fe5664f6e27846f060276e765fddc
4+
config_hash: 456111b9d3664d8dbb99018e7dc88488

api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,26 @@ Convenience methods:
5959

6060
- <code title="post /v1/tasks/runs">client.task_run.<a href="./src/parallel/resources/task_run.py">execute</a>(input, processor, output: <a href="./src/parallel/types/task_spec_param.py">OutputSchema</a>) -> <a href="./src/parallel/types/task_run_result.py">TaskRunResult</a></code>
6161
- <code title="post /v1/tasks/runs">client.task_run.<a href="./src/parallel/resources/task_run.py">execute</a>(input, processor, output: Type[OutputT]) -> <a href="./src/parallel/types/parsed_task_run_result.py">ParsedTaskRunResult[OutputT]</a></code>
62+
# TaskGroup
63+
64+
Types:
65+
66+
```python
67+
from parallel.types import (
68+
TaskGroup,
69+
TaskGroupRunResponse,
70+
TaskGroupStatus,
71+
TaskGroupEventsResponse,
72+
TaskGroupGetRunsResponse,
73+
)
74+
```
75+
76+
Methods:
77+
78+
- <code title="post /v1/tasks/groups">client.task_group.<a href="./src/parallel/resources/task_group.py">create</a>(\*\*<a href="src/parallel/types/task_group_create_params.py">params</a>) -> <a href="./src/parallel/types/task_group.py">TaskGroup</a></code>
79+
- <code title="get /v1/tasks/groups/{taskgroup_id}">client.task_group.<a href="./src/parallel/resources/task_group.py">retrieve</a>(task_group_id) -> <a href="./src/parallel/types/task_group.py">TaskGroup</a></code>
80+
- <code title="post /v1/tasks/groups/{taskgroup_id}/runs">client.task_group.<a href="./src/parallel/resources/task_group.py">add_runs</a>(task_group_id, \*\*<a href="src/parallel/types/task_group_add_runs_params.py">params</a>) -> <a href="./src/parallel/types/task_group_run_response.py">TaskGroupRunResponse</a></code>
81+
- <code title="get /v1/tasks/groups/{taskgroup_id}/events">client.task_group.<a href="./src/parallel/resources/task_group.py">events</a>(task_group_id, \*\*<a href="src/parallel/types/task_group_events_params.py">params</a>) -> <a href="./src/parallel/types/task_group_events_response.py">TaskGroupEventsResponse</a></code>
82+
- <code title="get /v1/tasks/groups/{taskgroup_id}/runs">client.task_group.<a href="./src/parallel/resources/task_group.py">get_runs</a>(task_group_id, \*\*<a href="src/parallel/types/task_group_get_runs_params.py">params</a>) -> <a href="./src/parallel/types/task_group_get_runs_response.py">TaskGroupGetRunsResponse</a></code>
83+
6284
# [Beta](src/parallel/resources/beta/api.md)

src/parallel/_client.py

Lines changed: 116 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@
5454
from .types.advanced_extract_settings_param import AdvancedExtractSettingsParam
5555

5656
if TYPE_CHECKING:
57-
from .resources import beta, task_run
57+
from .resources import beta, task_run, task_group
5858
from .resources.task_run import TaskRunResource, AsyncTaskRunResource
5959
from .resources.beta.beta import BetaResource, AsyncBetaResource
60+
from .resources.task_group import TaskGroupResource, AsyncTaskGroupResource
6061

6162
__all__ = [
6263
"Timeout",
@@ -142,7 +143,7 @@ def task_run(self) -> TaskRunResource:
142143
- Output metadata: citations, excerpts, reasoning, and confidence per field
143144
144145
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
145-
- Submit hundreds or thousands of Tasks as a single group
146+
- Submit hundreds or thousands of Tasks as a single group
146147
- Observe group progress and receive results as they complete
147148
- Real-time updates via Server-Sent Events (SSE)
148149
- Add tasks to an existing group while it is running
@@ -152,6 +153,24 @@ def task_run(self) -> TaskRunResource:
152153

153154
return TaskRunResource(self)
154155

156+
@cached_property
157+
def task_group(self) -> TaskGroupResource:
158+
"""The Task API executes web research and extraction tasks.
159+
160+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
161+
- Output metadata: citations, excerpts, reasoning, and confidence per field
162+
163+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
164+
- Submit hundreds or thousands of Tasks as a single group
165+
- Observe group progress and receive results as they complete
166+
- Real-time updates via Server-Sent Events (SSE)
167+
- Add tasks to an existing group while it is running
168+
- Group-level retry and error aggregation
169+
"""
170+
from .resources.task_group import TaskGroupResource
171+
172+
return TaskGroupResource(self)
173+
155174
@cached_property
156175
def beta(self) -> BetaResource:
157176
from .resources.beta import BetaResource
@@ -502,7 +521,7 @@ def task_run(self) -> AsyncTaskRunResource:
502521
- Output metadata: citations, excerpts, reasoning, and confidence per field
503522
504523
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
505-
- Submit hundreds or thousands of Tasks as a single group
524+
- Submit hundreds or thousands of Tasks as a single group
506525
- Observe group progress and receive results as they complete
507526
- Real-time updates via Server-Sent Events (SSE)
508527
- Add tasks to an existing group while it is running
@@ -512,6 +531,24 @@ def task_run(self) -> AsyncTaskRunResource:
512531

513532
return AsyncTaskRunResource(self)
514533

534+
@cached_property
535+
def task_group(self) -> AsyncTaskGroupResource:
536+
"""The Task API executes web research and extraction tasks.
537+
538+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
539+
- Output metadata: citations, excerpts, reasoning, and confidence per field
540+
541+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
542+
- Submit hundreds or thousands of Tasks as a single group
543+
- Observe group progress and receive results as they complete
544+
- Real-time updates via Server-Sent Events (SSE)
545+
- Add tasks to an existing group while it is running
546+
- Group-level retry and error aggregation
547+
"""
548+
from .resources.task_group import AsyncTaskGroupResource
549+
550+
return AsyncTaskGroupResource(self)
551+
515552
@cached_property
516553
def beta(self) -> AsyncBetaResource:
517554
from .resources.beta import AsyncBetaResource
@@ -811,7 +848,7 @@ def task_run(self) -> task_run.TaskRunResourceWithRawResponse:
811848
- Output metadata: citations, excerpts, reasoning, and confidence per field
812849
813850
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
814-
- Submit hundreds or thousands of Tasks as a single group
851+
- Submit hundreds or thousands of Tasks as a single group
815852
- Observe group progress and receive results as they complete
816853
- Real-time updates via Server-Sent Events (SSE)
817854
- Add tasks to an existing group while it is running
@@ -821,6 +858,24 @@ def task_run(self) -> task_run.TaskRunResourceWithRawResponse:
821858

822859
return TaskRunResourceWithRawResponse(self._client.task_run)
823860

861+
@cached_property
862+
def task_group(self) -> task_group.TaskGroupResourceWithRawResponse:
863+
"""The Task API executes web research and extraction tasks.
864+
865+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
866+
- Output metadata: citations, excerpts, reasoning, and confidence per field
867+
868+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
869+
- Submit hundreds or thousands of Tasks as a single group
870+
- Observe group progress and receive results as they complete
871+
- Real-time updates via Server-Sent Events (SSE)
872+
- Add tasks to an existing group while it is running
873+
- Group-level retry and error aggregation
874+
"""
875+
from .resources.task_group import TaskGroupResourceWithRawResponse
876+
877+
return TaskGroupResourceWithRawResponse(self._client.task_group)
878+
824879
@cached_property
825880
def beta(self) -> beta.BetaResourceWithRawResponse:
826881
from .resources.beta import BetaResourceWithRawResponse
@@ -849,7 +904,7 @@ def task_run(self) -> task_run.AsyncTaskRunResourceWithRawResponse:
849904
- Output metadata: citations, excerpts, reasoning, and confidence per field
850905
851906
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
852-
- Submit hundreds or thousands of Tasks as a single group
907+
- Submit hundreds or thousands of Tasks as a single group
853908
- Observe group progress and receive results as they complete
854909
- Real-time updates via Server-Sent Events (SSE)
855910
- Add tasks to an existing group while it is running
@@ -859,6 +914,24 @@ def task_run(self) -> task_run.AsyncTaskRunResourceWithRawResponse:
859914

860915
return AsyncTaskRunResourceWithRawResponse(self._client.task_run)
861916

917+
@cached_property
918+
def task_group(self) -> task_group.AsyncTaskGroupResourceWithRawResponse:
919+
"""The Task API executes web research and extraction tasks.
920+
921+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
922+
- Output metadata: citations, excerpts, reasoning, and confidence per field
923+
924+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
925+
- Submit hundreds or thousands of Tasks as a single group
926+
- Observe group progress and receive results as they complete
927+
- Real-time updates via Server-Sent Events (SSE)
928+
- Add tasks to an existing group while it is running
929+
- Group-level retry and error aggregation
930+
"""
931+
from .resources.task_group import AsyncTaskGroupResourceWithRawResponse
932+
933+
return AsyncTaskGroupResourceWithRawResponse(self._client.task_group)
934+
862935
@cached_property
863936
def beta(self) -> beta.AsyncBetaResourceWithRawResponse:
864937
from .resources.beta import AsyncBetaResourceWithRawResponse
@@ -887,7 +960,7 @@ def task_run(self) -> task_run.TaskRunResourceWithStreamingResponse:
887960
- Output metadata: citations, excerpts, reasoning, and confidence per field
888961
889962
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
890-
- Submit hundreds or thousands of Tasks as a single group
963+
- Submit hundreds or thousands of Tasks as a single group
891964
- Observe group progress and receive results as they complete
892965
- Real-time updates via Server-Sent Events (SSE)
893966
- Add tasks to an existing group while it is running
@@ -897,6 +970,24 @@ def task_run(self) -> task_run.TaskRunResourceWithStreamingResponse:
897970

898971
return TaskRunResourceWithStreamingResponse(self._client.task_run)
899972

973+
@cached_property
974+
def task_group(self) -> task_group.TaskGroupResourceWithStreamingResponse:
975+
"""The Task API executes web research and extraction tasks.
976+
977+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
978+
- Output metadata: citations, excerpts, reasoning, and confidence per field
979+
980+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
981+
- Submit hundreds or thousands of Tasks as a single group
982+
- Observe group progress and receive results as they complete
983+
- Real-time updates via Server-Sent Events (SSE)
984+
- Add tasks to an existing group while it is running
985+
- Group-level retry and error aggregation
986+
"""
987+
from .resources.task_group import TaskGroupResourceWithStreamingResponse
988+
989+
return TaskGroupResourceWithStreamingResponse(self._client.task_group)
990+
900991
@cached_property
901992
def beta(self) -> beta.BetaResourceWithStreamingResponse:
902993
from .resources.beta import BetaResourceWithStreamingResponse
@@ -925,7 +1016,7 @@ def task_run(self) -> task_run.AsyncTaskRunResourceWithStreamingResponse:
9251016
- Output metadata: citations, excerpts, reasoning, and confidence per field
9261017
9271018
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
928-
- Submit hundreds or thousands of Tasks as a single group
1019+
- Submit hundreds or thousands of Tasks as a single group
9291020
- Observe group progress and receive results as they complete
9301021
- Real-time updates via Server-Sent Events (SSE)
9311022
- Add tasks to an existing group while it is running
@@ -935,6 +1026,24 @@ def task_run(self) -> task_run.AsyncTaskRunResourceWithStreamingResponse:
9351026

9361027
return AsyncTaskRunResourceWithStreamingResponse(self._client.task_run)
9371028

1029+
@cached_property
1030+
def task_group(self) -> task_group.AsyncTaskGroupResourceWithStreamingResponse:
1031+
"""The Task API executes web research and extraction tasks.
1032+
1033+
Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
1034+
- Output metadata: citations, excerpts, reasoning, and confidence per field
1035+
1036+
Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
1037+
- Submit hundreds or thousands of Tasks as a single group
1038+
- Observe group progress and receive results as they complete
1039+
- Real-time updates via Server-Sent Events (SSE)
1040+
- Add tasks to an existing group while it is running
1041+
- Group-level retry and error aggregation
1042+
"""
1043+
from .resources.task_group import AsyncTaskGroupResourceWithStreamingResponse
1044+
1045+
return AsyncTaskGroupResourceWithStreamingResponse(self._client.task_group)
1046+
9381047
@cached_property
9391048
def beta(self) -> beta.AsyncBetaResourceWithStreamingResponse:
9401049
from .resources.beta import AsyncBetaResourceWithStreamingResponse

src/parallel/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
TaskRunResourceWithStreamingResponse,
99
AsyncTaskRunResourceWithStreamingResponse,
1010
)
11+
from .task_group import (
12+
TaskGroupResource,
13+
AsyncTaskGroupResource,
14+
TaskGroupResourceWithRawResponse,
15+
AsyncTaskGroupResourceWithRawResponse,
16+
TaskGroupResourceWithStreamingResponse,
17+
AsyncTaskGroupResourceWithStreamingResponse,
18+
)
1119

1220
__all__ = [
1321
"TaskRunResource",
@@ -16,4 +24,10 @@
1624
"AsyncTaskRunResourceWithRawResponse",
1725
"TaskRunResourceWithStreamingResponse",
1826
"AsyncTaskRunResourceWithStreamingResponse",
27+
"TaskGroupResource",
28+
"AsyncTaskGroupResource",
29+
"TaskGroupResourceWithRawResponse",
30+
"AsyncTaskGroupResourceWithRawResponse",
31+
"TaskGroupResourceWithStreamingResponse",
32+
"AsyncTaskGroupResourceWithStreamingResponse",
1933
]

src/parallel/resources/beta/api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ Types:
5050

5151
```python
5252
from parallel.types.beta import (
53-
TaskGroup,
54-
TaskGroupRunResponse,
55-
TaskGroupStatus,
5653
TaskGroupEventsResponse,
5754
TaskGroupGetRunsResponse,
55+
TaskGroupStatus,
56+
TaskGroup,
57+
TaskGroupRunResponse,
5858
)
5959
```
6060

6161
Methods:
6262

63-
- <code title="post /v1beta/tasks/groups">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">create</a>(\*\*<a href="src/parallel/types/beta/task_group_create_params.py">params</a>) -> <a href="./src/parallel/types/beta/task_group.py">TaskGroup</a></code>
64-
- <code title="get /v1beta/tasks/groups/{taskgroup_id}">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">retrieve</a>(task_group_id) -> <a href="./src/parallel/types/beta/task_group.py">TaskGroup</a></code>
65-
- <code title="post /v1beta/tasks/groups/{taskgroup_id}/runs">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">add_runs</a>(task_group_id, \*\*<a href="src/parallel/types/beta/task_group_add_runs_params.py">params</a>) -> <a href="./src/parallel/types/beta/task_group_run_response.py">TaskGroupRunResponse</a></code>
63+
- <code title="post /v1beta/tasks/groups">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">create</a>(\*\*<a href="src/parallel/types/beta/task_group_create_params.py">params</a>) -> <a href="./src/parallel/types/task_group.py">TaskGroup</a></code>
64+
- <code title="get /v1beta/tasks/groups/{taskgroup_id}">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">retrieve</a>(task_group_id) -> <a href="./src/parallel/types/task_group.py">TaskGroup</a></code>
65+
- <code title="post /v1beta/tasks/groups/{taskgroup_id}/runs">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">add_runs</a>(task_group_id, \*\*<a href="src/parallel/types/beta/task_group_add_runs_params.py">params</a>) -> <a href="./src/parallel/types/task_group_run_response.py">TaskGroupRunResponse</a></code>
6666
- <code title="get /v1beta/tasks/groups/{taskgroup_id}/events">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">events</a>(task_group_id, \*\*<a href="src/parallel/types/beta/task_group_events_params.py">params</a>) -> <a href="./src/parallel/types/beta/task_group_events_response.py">TaskGroupEventsResponse</a></code>
6767
- <code title="get /v1beta/tasks/groups/{taskgroup_id}/runs">client.beta.task_group.<a href="./src/parallel/resources/beta/task_group.py">get_runs</a>(task_group_id, \*\*<a href="src/parallel/types/beta/task_group_get_runs_params.py">params</a>) -> <a href="./src/parallel/types/beta/task_group_get_runs_response.py">TaskGroupGetRunsResponse</a></code>
6868

0 commit comments

Comments
 (0)