parallel-web 0.2.1__py3-none-any.whl → 0.2.2__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.

Potentially problematic release.


This version of parallel-web might be problematic. Click here for more details.

@@ -7,7 +7,7 @@ from typing_extensions import Literal
7
7
 
8
8
  import httpx
9
9
 
10
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
11
  from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform
12
12
  from ..._compat import cached_property
13
13
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -59,13 +59,13 @@ class TaskGroupResource(SyncAPIResource):
59
59
  def create(
60
60
  self,
61
61
  *,
62
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
62
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
63
63
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
64
64
  # The extra values given here take precedence over values defined on the client or passed to this method.
65
65
  extra_headers: Headers | None = None,
66
66
  extra_query: Query | None = None,
67
67
  extra_body: Body | None = None,
68
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
68
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
69
69
  ) -> TaskGroup:
70
70
  """
71
71
  Initiates a TaskGroup to group and track multiple runs.
@@ -99,7 +99,7 @@ class TaskGroupResource(SyncAPIResource):
99
99
  extra_headers: Headers | None = None,
100
100
  extra_query: Query | None = None,
101
101
  extra_body: Body | None = None,
102
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
102
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
103
103
  ) -> TaskGroup:
104
104
  """
105
105
  Retrieves aggregated status across runs in a TaskGroup.
@@ -128,14 +128,14 @@ class TaskGroupResource(SyncAPIResource):
128
128
  task_group_id: str,
129
129
  *,
130
130
  inputs: Iterable[BetaRunInputParam],
131
- default_task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
132
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
131
+ default_task_spec: Optional[TaskSpecParam] | Omit = omit,
132
+ betas: List[ParallelBetaParam] | Omit = omit,
133
133
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134
134
  # The extra values given here take precedence over values defined on the client or passed to this method.
135
135
  extra_headers: Headers | None = None,
136
136
  extra_query: Query | None = None,
137
137
  extra_body: Body | None = None,
138
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
138
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
139
139
  ) -> TaskGroupRunResponse:
140
140
  """
141
141
  Initiates multiple task runs within a TaskGroup.
@@ -163,7 +163,7 @@ class TaskGroupResource(SyncAPIResource):
163
163
  if not task_group_id:
164
164
  raise ValueError(f"Expected a non-empty value for `task_group_id` but received {task_group_id!r}")
165
165
  extra_headers = {
166
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
166
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
167
167
  **(extra_headers or {}),
168
168
  }
169
169
  return self._post(
@@ -185,20 +185,20 @@ class TaskGroupResource(SyncAPIResource):
185
185
  self,
186
186
  task_group_id: str,
187
187
  *,
188
- last_event_id: Optional[str] | NotGiven = NOT_GIVEN,
189
- api_timeout: Optional[float] | NotGiven = NOT_GIVEN,
188
+ last_event_id: Optional[str] | Omit = omit,
189
+ api_timeout: Optional[float] | Omit = omit,
190
190
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
191
191
  # The extra values given here take precedence over values defined on the client or passed to this method.
192
192
  extra_headers: Headers | None = None,
193
193
  extra_query: Query | None = None,
194
194
  extra_body: Body | None = None,
195
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
195
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
196
196
  ) -> Stream[TaskGroupEventsResponse]:
197
197
  """
198
198
  Streams events from a TaskGroup: status updates and run completions.
199
199
 
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.
202
202
 
203
203
  Args:
204
204
  extra_headers: Send extra headers
@@ -238,23 +238,32 @@ class TaskGroupResource(SyncAPIResource):
238
238
  self,
239
239
  task_group_id: str,
240
240
  *,
241
- include_input: bool | NotGiven = NOT_GIVEN,
242
- include_output: bool | NotGiven = NOT_GIVEN,
243
- last_event_id: Optional[str] | NotGiven = NOT_GIVEN,
241
+ include_input: bool | Omit = omit,
242
+ include_output: bool | Omit = omit,
243
+ last_event_id: Optional[str] | Omit = omit,
244
244
  status: Optional[
245
245
  Literal["queued", "action_required", "running", "completed", "failed", "cancelling", "cancelled"]
246
246
  ]
247
- | NotGiven = NOT_GIVEN,
247
+ | Omit = omit,
248
248
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
249
249
  # The extra values given here take precedence over values defined on the client or passed to this method.
250
250
  extra_headers: Headers | None = None,
251
251
  extra_query: Query | None = None,
252
252
  extra_body: Body | None = None,
253
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
253
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
254
254
  ) -> Stream[TaskGroupGetRunsResponse]:
255
255
  """
256
256
  Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
257
257
 
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
+
258
267
  Args:
259
268
  extra_headers: Send extra headers
260
269
 
@@ -315,13 +324,13 @@ class AsyncTaskGroupResource(AsyncAPIResource):
315
324
  async def create(
316
325
  self,
317
326
  *,
318
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
327
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
319
328
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
320
329
  # The extra values given here take precedence over values defined on the client or passed to this method.
321
330
  extra_headers: Headers | None = None,
322
331
  extra_query: Query | None = None,
323
332
  extra_body: Body | None = None,
324
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
333
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
325
334
  ) -> TaskGroup:
326
335
  """
327
336
  Initiates a TaskGroup to group and track multiple runs.
@@ -355,7 +364,7 @@ class AsyncTaskGroupResource(AsyncAPIResource):
355
364
  extra_headers: Headers | None = None,
356
365
  extra_query: Query | None = None,
357
366
  extra_body: Body | None = None,
358
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
367
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
359
368
  ) -> TaskGroup:
360
369
  """
361
370
  Retrieves aggregated status across runs in a TaskGroup.
@@ -384,14 +393,14 @@ class AsyncTaskGroupResource(AsyncAPIResource):
384
393
  task_group_id: str,
385
394
  *,
386
395
  inputs: Iterable[BetaRunInputParam],
387
- default_task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
388
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
396
+ default_task_spec: Optional[TaskSpecParam] | Omit = omit,
397
+ betas: List[ParallelBetaParam] | Omit = omit,
389
398
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
390
399
  # The extra values given here take precedence over values defined on the client or passed to this method.
391
400
  extra_headers: Headers | None = None,
392
401
  extra_query: Query | None = None,
393
402
  extra_body: Body | None = None,
394
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
403
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
395
404
  ) -> TaskGroupRunResponse:
396
405
  """
397
406
  Initiates multiple task runs within a TaskGroup.
@@ -419,7 +428,7 @@ class AsyncTaskGroupResource(AsyncAPIResource):
419
428
  if not task_group_id:
420
429
  raise ValueError(f"Expected a non-empty value for `task_group_id` but received {task_group_id!r}")
421
430
  extra_headers = {
422
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
431
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
423
432
  **(extra_headers or {}),
424
433
  }
425
434
  return await self._post(
@@ -441,20 +450,20 @@ class AsyncTaskGroupResource(AsyncAPIResource):
441
450
  self,
442
451
  task_group_id: str,
443
452
  *,
444
- last_event_id: Optional[str] | NotGiven = NOT_GIVEN,
445
- api_timeout: Optional[float] | NotGiven = NOT_GIVEN,
453
+ last_event_id: Optional[str] | Omit = omit,
454
+ api_timeout: Optional[float] | Omit = omit,
446
455
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
447
456
  # The extra values given here take precedence over values defined on the client or passed to this method.
448
457
  extra_headers: Headers | None = None,
449
458
  extra_query: Query | None = None,
450
459
  extra_body: Body | None = None,
451
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
460
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
452
461
  ) -> AsyncStream[TaskGroupEventsResponse]:
453
462
  """
454
463
  Streams events from a TaskGroup: status updates and run completions.
455
464
 
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.
458
467
 
459
468
  Args:
460
469
  extra_headers: Send extra headers
@@ -494,23 +503,32 @@ class AsyncTaskGroupResource(AsyncAPIResource):
494
503
  self,
495
504
  task_group_id: str,
496
505
  *,
497
- include_input: bool | NotGiven = NOT_GIVEN,
498
- include_output: bool | NotGiven = NOT_GIVEN,
499
- last_event_id: Optional[str] | NotGiven = NOT_GIVEN,
506
+ include_input: bool | Omit = omit,
507
+ include_output: bool | Omit = omit,
508
+ last_event_id: Optional[str] | Omit = omit,
500
509
  status: Optional[
501
510
  Literal["queued", "action_required", "running", "completed", "failed", "cancelling", "cancelled"]
502
511
  ]
503
- | NotGiven = NOT_GIVEN,
512
+ | Omit = omit,
504
513
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
505
514
  # The extra values given here take precedence over values defined on the client or passed to this method.
506
515
  extra_headers: Headers | None = None,
507
516
  extra_query: Query | None = None,
508
517
  extra_body: Body | None = None,
509
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
518
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
510
519
  ) -> AsyncStream[TaskGroupGetRunsResponse]:
511
520
  """
512
521
  Retrieves task runs in a TaskGroup and optionally their inputs and outputs.
513
522
 
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
+
514
532
  Args:
515
533
  extra_headers: Send extra headers
516
534
 
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union, Iterable, Optional, cast
6
6
 
7
7
  import httpx
8
8
 
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10
10
  from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform
11
11
  from ..._compat import cached_property
12
12
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -56,19 +56,19 @@ class TaskRunResource(SyncAPIResource):
56
56
  *,
57
57
  input: Union[str, Dict[str, object]],
58
58
  processor: str,
59
- enable_events: Optional[bool] | NotGiven = NOT_GIVEN,
60
- mcp_servers: Optional[Iterable[McpServerParam]] | NotGiven = NOT_GIVEN,
61
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
62
- source_policy: Optional[SourcePolicy] | NotGiven = NOT_GIVEN,
63
- task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
64
- webhook: Optional[WebhookParam] | NotGiven = NOT_GIVEN,
65
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
59
+ enable_events: Optional[bool] | Omit = omit,
60
+ mcp_servers: Optional[Iterable[McpServerParam]] | Omit = omit,
61
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
62
+ source_policy: Optional[SourcePolicy] | Omit = omit,
63
+ task_spec: Optional[TaskSpecParam] | Omit = omit,
64
+ webhook: Optional[WebhookParam] | Omit = omit,
65
+ betas: List[ParallelBetaParam] | Omit = omit,
66
66
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
67
67
  # The extra values given here take precedence over values defined on the client or passed to this method.
68
68
  extra_headers: Headers | None = None,
69
69
  extra_query: Query | None = None,
70
70
  extra_body: Body | None = None,
71
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
71
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
72
72
  ) -> TaskRun:
73
73
  """
74
74
  Initiates a task run.
@@ -87,13 +87,13 @@ class TaskRunResource(SyncAPIResource):
87
87
  [Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
88
88
  false, no progress events are tracked. Note that progress tracking cannot be
89
89
  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).
93
93
 
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).
97
97
 
98
98
  metadata: User-provided metadata stored with the run. Keys and values must be strings with
99
99
  a maximum length of 16 and 512 characters respectively.
@@ -122,7 +122,7 @@ class TaskRunResource(SyncAPIResource):
122
122
  timeout: Override the client-level default timeout for this request, in seconds
123
123
  """
124
124
  extra_headers = {
125
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
125
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
126
126
  **(extra_headers or {}),
127
127
  }
128
128
  return self._post(
@@ -155,7 +155,7 @@ class TaskRunResource(SyncAPIResource):
155
155
  extra_headers: Headers | None = None,
156
156
  extra_query: Query | None = None,
157
157
  extra_body: Body | None = None,
158
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
158
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
159
159
  ) -> Stream[TaskRunEventsResponse]:
160
160
  """
161
161
  Streams events for a task run.
@@ -192,14 +192,14 @@ class TaskRunResource(SyncAPIResource):
192
192
  self,
193
193
  run_id: str,
194
194
  *,
195
- api_timeout: int | NotGiven = NOT_GIVEN,
196
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
195
+ api_timeout: int | Omit = omit,
196
+ betas: List[ParallelBetaParam] | Omit = omit,
197
197
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
198
198
  # The extra values given here take precedence over values defined on the client or passed to this method.
199
199
  extra_headers: Headers | None = None,
200
200
  extra_query: Query | None = None,
201
201
  extra_body: Body | None = None,
202
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
202
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
203
203
  ) -> BetaTaskRunResult:
204
204
  """
205
205
  Retrieves a run result by run_id, blocking until the run is completed.
@@ -218,7 +218,7 @@ class TaskRunResource(SyncAPIResource):
218
218
  if not run_id:
219
219
  raise ValueError(f"Expected a non-empty value for `run_id` but received {run_id!r}")
220
220
  extra_headers = {
221
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
221
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
222
222
  **(extra_headers or {}),
223
223
  }
224
224
  return self._get(
@@ -259,19 +259,19 @@ class AsyncTaskRunResource(AsyncAPIResource):
259
259
  *,
260
260
  input: Union[str, Dict[str, object]],
261
261
  processor: str,
262
- enable_events: Optional[bool] | NotGiven = NOT_GIVEN,
263
- mcp_servers: Optional[Iterable[McpServerParam]] | NotGiven = NOT_GIVEN,
264
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
265
- source_policy: Optional[SourcePolicy] | NotGiven = NOT_GIVEN,
266
- task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
267
- webhook: Optional[WebhookParam] | NotGiven = NOT_GIVEN,
268
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
262
+ enable_events: Optional[bool] | Omit = omit,
263
+ mcp_servers: Optional[Iterable[McpServerParam]] | Omit = omit,
264
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
265
+ source_policy: Optional[SourcePolicy] | Omit = omit,
266
+ task_spec: Optional[TaskSpecParam] | Omit = omit,
267
+ webhook: Optional[WebhookParam] | Omit = omit,
268
+ betas: List[ParallelBetaParam] | Omit = omit,
269
269
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
270
270
  # The extra values given here take precedence over values defined on the client or passed to this method.
271
271
  extra_headers: Headers | None = None,
272
272
  extra_query: Query | None = None,
273
273
  extra_body: Body | None = None,
274
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
274
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
275
275
  ) -> TaskRun:
276
276
  """
277
277
  Initiates a task run.
@@ -290,13 +290,13 @@ class AsyncTaskRunResource(AsyncAPIResource):
290
290
  [Task Run events](https://platform.parallel.ai/api-reference) endpoint. When
291
291
  false, no progress events are tracked. Note that progress tracking cannot be
292
292
  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).
296
296
 
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).
300
300
 
301
301
  metadata: User-provided metadata stored with the run. Keys and values must be strings with
302
302
  a maximum length of 16 and 512 characters respectively.
@@ -325,7 +325,7 @@ class AsyncTaskRunResource(AsyncAPIResource):
325
325
  timeout: Override the client-level default timeout for this request, in seconds
326
326
  """
327
327
  extra_headers = {
328
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
328
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
329
329
  **(extra_headers or {}),
330
330
  }
331
331
  return await self._post(
@@ -358,7 +358,7 @@ class AsyncTaskRunResource(AsyncAPIResource):
358
358
  extra_headers: Headers | None = None,
359
359
  extra_query: Query | None = None,
360
360
  extra_body: Body | None = None,
361
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
361
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
362
362
  ) -> AsyncStream[TaskRunEventsResponse]:
363
363
  """
364
364
  Streams events for a task run.
@@ -395,14 +395,14 @@ class AsyncTaskRunResource(AsyncAPIResource):
395
395
  self,
396
396
  run_id: str,
397
397
  *,
398
- api_timeout: int | NotGiven = NOT_GIVEN,
399
- betas: List[ParallelBetaParam] | NotGiven = NOT_GIVEN,
398
+ api_timeout: int | Omit = omit,
399
+ betas: List[ParallelBetaParam] | Omit = omit,
400
400
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
401
401
  # The extra values given here take precedence over values defined on the client or passed to this method.
402
402
  extra_headers: Headers | None = None,
403
403
  extra_query: Query | None = None,
404
404
  extra_body: Body | None = None,
405
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
405
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
406
406
  ) -> BetaTaskRunResult:
407
407
  """
408
408
  Retrieves a run result by run_id, blocking until the run is completed.
@@ -421,7 +421,7 @@ class AsyncTaskRunResource(AsyncAPIResource):
421
421
  if not run_id:
422
422
  raise ValueError(f"Expected a non-empty value for `run_id` but received {run_id!r}")
423
423
  extra_headers = {
424
- **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else NOT_GIVEN}),
424
+ **strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
425
425
  **(extra_headers or {}),
426
426
  }
427
427
  return await self._get(
@@ -10,7 +10,7 @@ import httpx
10
10
  from parallel.lib._time import prepare_timeout_float
11
11
 
12
12
  from ..types import task_run_create_params, task_run_result_params
13
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
13
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
14
14
  from .._utils import maybe_transform, async_maybe_transform
15
15
  from .._compat import cached_property
16
16
  from .._resource import SyncAPIResource, AsyncAPIResource
@@ -61,15 +61,15 @@ class TaskRunResource(SyncAPIResource):
61
61
  *,
62
62
  input: Union[str, Dict[str, object]],
63
63
  processor: str,
64
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
65
- source_policy: Optional[SourcePolicy] | NotGiven = NOT_GIVEN,
66
- task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
64
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
65
+ source_policy: Optional[SourcePolicy] | Omit = omit,
66
+ task_spec: Optional[TaskSpecParam] | Omit = omit,
67
67
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
68
  # The extra values given here take precedence over values defined on the client or passed to this method.
69
69
  extra_headers: Headers | None = None,
70
70
  extra_query: Query | None = None,
71
71
  extra_body: Body | None = None,
72
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
72
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
73
73
  ) -> TaskRun:
74
74
  """
75
75
  Initiates a task run.
@@ -132,7 +132,7 @@ class TaskRunResource(SyncAPIResource):
132
132
  extra_headers: Headers | None = None,
133
133
  extra_query: Query | None = None,
134
134
  extra_body: Body | None = None,
135
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
135
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
136
136
  ) -> TaskRun:
137
137
  """
138
138
  Retrieves run status by run_id.
@@ -162,13 +162,13 @@ class TaskRunResource(SyncAPIResource):
162
162
  self,
163
163
  run_id: str,
164
164
  *,
165
- api_timeout: int | NotGiven = NOT_GIVEN,
165
+ api_timeout: int | Omit = omit,
166
166
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167
167
  # The extra values given here take precedence over values defined on the client or passed to this method.
168
168
  extra_headers: Headers | None = None,
169
169
  extra_query: Query | None = None,
170
170
  extra_body: Body | None = None,
171
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
171
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
172
172
  ) -> TaskRunResult:
173
173
  """
174
174
  Retrieves a run result by run_id, blocking until the run is completed.
@@ -201,7 +201,7 @@ class TaskRunResource(SyncAPIResource):
201
201
  *,
202
202
  run_id: str,
203
203
  deadline: float,
204
- output: Optional[OutputSchema] | Type[OutputT] | NotGiven = NOT_GIVEN,
204
+ output: Optional[OutputSchema] | Type[OutputT] | Omit = omit,
205
205
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
206
206
  # The extra values given here take precedence over values defined on the client or passed to this method.
207
207
  extra_headers: Headers | None = None,
@@ -229,14 +229,14 @@ class TaskRunResource(SyncAPIResource):
229
229
  *,
230
230
  input: Union[str, Dict[str, object]],
231
231
  processor: str,
232
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
233
- output: Optional[OutputSchema] | NotGiven = NOT_GIVEN,
232
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
233
+ output: Optional[OutputSchema] | Omit = omit,
234
234
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
235
235
  # The extra values given here take precedence over values defined on the client or passed to this method.
236
236
  extra_headers: Headers | None = None,
237
237
  extra_query: Query | None = None,
238
238
  extra_body: Body | None = None,
239
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
239
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
240
240
  ) -> TaskRunResult: ...
241
241
  @overload
242
242
  def execute(
@@ -244,28 +244,28 @@ class TaskRunResource(SyncAPIResource):
244
244
  *,
245
245
  input: Union[str, Dict[str, object]],
246
246
  processor: str,
247
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
247
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
248
248
  output: Type[OutputT],
249
249
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
250
250
  # The extra values given here take precedence over values defined on the client or passed to this method.
251
251
  extra_headers: Headers | None = None,
252
252
  extra_query: Query | None = None,
253
253
  extra_body: Body | None = None,
254
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
254
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
255
255
  ) -> ParsedTaskRunResult[OutputT]: ...
256
256
  def execute(
257
257
  self,
258
258
  *,
259
259
  input: Union[str, Dict[str, object]],
260
260
  processor: str,
261
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
262
- output: Optional[OutputSchema] | Type[OutputT] | NotGiven = NOT_GIVEN,
261
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
262
+ output: Optional[OutputSchema] | Type[OutputT] | Omit = omit,
263
263
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
264
264
  # The extra values given here take precedence over values defined on the client or passed to this method.
265
265
  extra_headers: Headers | None = None,
266
266
  extra_query: Query | None = None,
267
267
  extra_body: Body | None = None,
268
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
268
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
269
269
  ) -> TaskRunResult | ParsedTaskRunResult[OutputT]:
270
270
  """
271
271
  Convenience method to create and execute a task run in a single call.
@@ -350,15 +350,15 @@ class AsyncTaskRunResource(AsyncAPIResource):
350
350
  *,
351
351
  input: Union[str, Dict[str, object]],
352
352
  processor: str,
353
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
354
- source_policy: Optional[SourcePolicy] | NotGiven = NOT_GIVEN,
355
- task_spec: Optional[TaskSpecParam] | NotGiven = NOT_GIVEN,
353
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
354
+ source_policy: Optional[SourcePolicy] | Omit = omit,
355
+ task_spec: Optional[TaskSpecParam] | Omit = omit,
356
356
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
357
357
  # The extra values given here take precedence over values defined on the client or passed to this method.
358
358
  extra_headers: Headers | None = None,
359
359
  extra_query: Query | None = None,
360
360
  extra_body: Body | None = None,
361
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
361
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
362
362
  ) -> TaskRun:
363
363
  """
364
364
  Initiates a task run.
@@ -421,7 +421,7 @@ class AsyncTaskRunResource(AsyncAPIResource):
421
421
  extra_headers: Headers | None = None,
422
422
  extra_query: Query | None = None,
423
423
  extra_body: Body | None = None,
424
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
424
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
425
425
  ) -> TaskRun:
426
426
  """
427
427
  Retrieves run status by run_id.
@@ -451,13 +451,13 @@ class AsyncTaskRunResource(AsyncAPIResource):
451
451
  self,
452
452
  run_id: str,
453
453
  *,
454
- api_timeout: int | NotGiven = NOT_GIVEN,
454
+ api_timeout: int | Omit = omit,
455
455
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
456
456
  # The extra values given here take precedence over values defined on the client or passed to this method.
457
457
  extra_headers: Headers | None = None,
458
458
  extra_query: Query | None = None,
459
459
  extra_body: Body | None = None,
460
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
460
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
461
461
  ) -> TaskRunResult:
462
462
  """
463
463
  Retrieves a run result by run_id, blocking until the run is completed.
@@ -492,7 +492,7 @@ class AsyncTaskRunResource(AsyncAPIResource):
492
492
  *,
493
493
  run_id: str,
494
494
  deadline: float,
495
- output: Optional[OutputSchema] | Type[OutputT] | NotGiven = NOT_GIVEN,
495
+ output: Optional[OutputSchema] | Type[OutputT] | Omit = omit,
496
496
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
497
497
  # The extra values given here take precedence over values defined on the client or passed to this method.
498
498
  extra_headers: Headers | None = None,
@@ -520,12 +520,12 @@ class AsyncTaskRunResource(AsyncAPIResource):
520
520
  *,
521
521
  input: Union[str, Dict[str, object]],
522
522
  processor: str,
523
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
524
- output: Optional[OutputSchema] | NotGiven = NOT_GIVEN,
523
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
524
+ output: Optional[OutputSchema] | Omit = omit,
525
525
  extra_headers: Headers | None = None,
526
526
  extra_query: Query | None = None,
527
527
  extra_body: Body | None = None,
528
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
528
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
529
529
  ) -> TaskRunResult: ...
530
530
  @overload
531
531
  async def execute(
@@ -533,26 +533,26 @@ class AsyncTaskRunResource(AsyncAPIResource):
533
533
  *,
534
534
  input: Union[str, Dict[str, object]],
535
535
  processor: str,
536
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
536
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
537
537
  output: Type[OutputT],
538
538
  extra_headers: Headers | None = None,
539
539
  extra_query: Query | None = None,
540
540
  extra_body: Body | None = None,
541
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
541
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
542
542
  ) -> ParsedTaskRunResult[OutputT]: ...
543
543
  async def execute(
544
544
  self,
545
545
  *,
546
546
  input: Union[str, Dict[str, object]],
547
547
  processor: str,
548
- metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
549
- output: Optional[OutputSchema] | Type[OutputT] | NotGiven = NOT_GIVEN,
548
+ metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
549
+ output: Optional[OutputSchema] | Type[OutputT] | Omit = omit,
550
550
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
551
551
  # The extra values given here take precedence over values defined on the client or passed to this method.
552
552
  extra_headers: Headers | None = None,
553
553
  extra_query: Query | None = None,
554
554
  extra_body: Body | None = None,
555
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
555
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
556
556
  ) -> TaskRunResult | ParsedTaskRunResult[OutputT]:
557
557
  """
558
558
  Convenience method to create and execute a task run in a single call.