parallel-web 0.4.1__tar.gz → 0.4.2__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.
- parallel_web-0.4.2/.release-please-manifest.json +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/CHANGELOG.md +24 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/CONTRIBUTING.md +1 -2
- {parallel_web-0.4.1 → parallel_web-0.4.2}/PKG-INFO +3 -2
- {parallel_web-0.4.1 → parallel_web-0.4.2}/README.md +2 -1
- parallel_web-0.4.2/api.md +38 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/pyproject.toml +2 -2
- {parallel_web-0.4.1 → parallel_web-0.4.2}/requirements-dev.lock +10 -10
- {parallel_web-0.4.1 → parallel_web-0.4.2}/requirements.lock +4 -4
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_base_client.py +5 -2
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_client.py +30 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_compat.py +3 -3
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_response.py +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_streaming.py +8 -3
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_compat.py +1 -1
- parallel_web-0.4.2/src/parallel/_utils/_json.py +35 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_version.py +1 -1
- {parallel_web-0.4.1 → parallel_web-0.4.2/src/parallel/resources/beta}/api.md +0 -37
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/beta/beta.py +122 -20
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/beta/findall.py +8 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/beta/task_group.py +24 -2
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/beta/task_run.py +20 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/task_run.py +20 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/beta_run_input.py +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/beta_run_input_param.py +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/beta_search_params.py +8 -8
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/excerpt_settings_param.py +3 -3
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_run.py +7 -1
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_add_runs_params.py +5 -1
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_run_create_params.py +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run.py +7 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run_create_params.py +3 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/beta/test_findall.py +10 -10
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/beta/test_task_group.py +22 -20
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/beta/test_task_run.py +10 -8
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/test_task_run.py +2 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_client.py +16 -0
- parallel_web-0.4.2/tests/test_utils/test_json.py +126 -0
- parallel_web-0.4.1/.release-please-manifest.json +0 -3
- {parallel_web-0.4.1 → parallel_web-0.4.2}/.gitignore +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/LICENSE +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/SECURITY.md +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/bin/check-release-environment +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/bin/publish-pypi +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/examples/.keep +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/noxfile.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/release-please-config.json +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_constants.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_exceptions.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_files.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_models.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_qs.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_resource.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_types.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_datetime_parse.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_logs.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_proxy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_reflection.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_resources_proxy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_streams.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_sync.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_transform.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_typing.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/_utils/_utils.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/.keep +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/_parsing/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/_parsing/_task_run_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/_parsing/_task_spec.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/_pydantic.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/lib/_time.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/py.typed +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/resources/beta/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/auto_schema.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/auto_schema_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/beta_extract_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/beta_task_run_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/error_event.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/extract_error.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/extract_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/extract_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/fetch_policy_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_candidate_match_status_event.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_create_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_enrich_input.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_enrich_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_events_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_events_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_extend_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_ingest_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_run_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_run_status_event.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_schema.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/findall_schema_updated_event.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/mcp_server.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/mcp_server_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/mcp_tool_call.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/parallel_beta_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/search_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_create_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_events_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_events_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_get_runs_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_get_runs_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_run_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_group_status.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_run_event.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_run_events_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/task_run_result_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/usage_item.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/web_search_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/webhook.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/beta/webhook_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/citation.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/field_basis.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/json_schema.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/json_schema_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/parsed_task_run_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared/error_object.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared/error_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared/source_policy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared/warning.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared_params/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/shared_params/source_policy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run_json_output.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run_result.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run_result_params.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_run_text_output.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_spec.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/task_spec_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/text_schema.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/src/parallel/types/text_schema_param.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/beta/__init__.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/api_resources/test_beta.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/conftest.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/sample_file.txt +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_deepcopy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_extract_files.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_files.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_models.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_qs.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_required_args.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_response.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_streaming.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_transform.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_utils/test_datetime_parse.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_utils/test_proxy.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/test_utils/test_typing.py +0 -0
- {parallel_web-0.4.1 → parallel_web-0.4.2}/tests/utils.py +0 -0
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.2 (2026-03-09)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.4.1...v0.4.2](https://github.com/parallel-web/parallel-sdk-python/compare/v0.4.1...v0.4.2)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add betas back in for search ([23493c6](https://github.com/parallel-web/parallel-sdk-python/commit/23493c6ae666649f7ac2af185bb6caf49b9fefee))
|
|
10
|
+
* **api:** sync openapi spec ([e00288b](https://github.com/parallel-web/parallel-sdk-python/commit/e00288bd8ed2a250c9a0d7935a52fd40b9d1bec5))
|
|
11
|
+
* **client:** add custom JSON encoder for extended type support ([b2c8bf9](https://github.com/parallel-web/parallel-sdk-python/commit/b2c8bf9b8246e2e8f1d53a7c8e238dd19b727a77))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
* **ci:** skip uploading artifacts on stainless-internal branches ([bb389c0](https://github.com/parallel-web/parallel-sdk-python/commit/bb389c0078e00e615c1aa650674c006c6e906c81))
|
|
17
|
+
* format all `api.md` files ([b74b93b](https://github.com/parallel-web/parallel-sdk-python/commit/b74b93bf04d678cc283b8f312a3a4c5bb314c468))
|
|
18
|
+
* **internal:** add request options to SSE classes ([00dbc30](https://github.com/parallel-web/parallel-sdk-python/commit/00dbc3027e59adda51eb623d6a724501f70a7720))
|
|
19
|
+
* **internal:** bump dependencies ([f49c841](https://github.com/parallel-web/parallel-sdk-python/commit/f49c841670d88f8fc38e0a17f19242f7570a9aad))
|
|
20
|
+
* **internal:** codegen related update ([1b7c8ff](https://github.com/parallel-web/parallel-sdk-python/commit/1b7c8ff1969c65a422d6bcfcdc01c5b0c477b45b))
|
|
21
|
+
* **internal:** fix lint error on Python 3.14 ([cb3f364](https://github.com/parallel-web/parallel-sdk-python/commit/cb3f3645bc67b98235a732f357d8a24fdf164032))
|
|
22
|
+
* **internal:** make `test_proxy_environment_variables` more resilient ([d3ba149](https://github.com/parallel-web/parallel-sdk-python/commit/d3ba149917deab7ee28a3f38bd7b1f3f4bd2b9c6))
|
|
23
|
+
* **internal:** make `test_proxy_environment_variables` more resilient to env ([1e1d858](https://github.com/parallel-web/parallel-sdk-python/commit/1e1d858e7c21785744d94ceef33e655dcf75eacc))
|
|
24
|
+
* **test:** do not count install time for mock server timeout ([9766097](https://github.com/parallel-web/parallel-sdk-python/commit/9766097052cc86f0081cfe38b25d7dbf90232438))
|
|
25
|
+
* update mock server docs ([028965c](https://github.com/parallel-web/parallel-sdk-python/commit/028965c0b2868051617b266493466f9fc7816705))
|
|
26
|
+
|
|
3
27
|
## 0.4.1 (2026-01-28)
|
|
4
28
|
|
|
5
29
|
Full Changelog: [v0.4.0...v0.4.1](https://github.com/parallel-web/parallel-sdk-python/compare/v0.4.0...v0.4.1)
|
|
@@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
|
|
|
88
88
|
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
89
89
|
|
|
90
90
|
```sh
|
|
91
|
-
|
|
92
|
-
$ npx prism mock path/to/your/openapi.yml
|
|
91
|
+
$ ./scripts/mock
|
|
93
92
|
```
|
|
94
93
|
|
|
95
94
|
```sh
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: parallel-web
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: The official Python library for the Parallel API
|
|
5
5
|
Project-URL: Homepage, https://github.com/parallel-web/parallel-sdk-python
|
|
6
6
|
Project-URL: Repository, https://github.com/parallel-web/parallel-sdk-python
|
|
@@ -133,6 +133,7 @@ All beta parameters are accessible via the `client.beta` namespace in the SDK.
|
|
|
133
133
|
|
|
134
134
|
Yes, all methods support a timeout. For more information, see [Timeouts](https://github.com/parallel-web/parallel-sdk-python/tree/main/#timeouts).
|
|
135
135
|
|
|
136
|
+
|
|
136
137
|
**Can I specify retries via the SDK?**
|
|
137
138
|
|
|
138
139
|
Yes, errors can be retried via the SDK — the default retry count is 2. The maximum number
|
|
@@ -327,7 +328,7 @@ response = client.task_run.with_raw_response.create(
|
|
|
327
328
|
print(response.headers.get('X-My-Header'))
|
|
328
329
|
|
|
329
330
|
task_run = response.parse()
|
|
330
|
-
print(task_run.
|
|
331
|
+
print(task_run.interaction_id)
|
|
331
332
|
```
|
|
332
333
|
|
|
333
334
|
These methods return an [`APIResponse`](https://github.com/parallel-web/parallel-sdk-python/tree/main/src/parallel/_response.py) object.
|
|
@@ -98,6 +98,7 @@ All beta parameters are accessible via the `client.beta` namespace in the SDK.
|
|
|
98
98
|
|
|
99
99
|
Yes, all methods support a timeout. For more information, see [Timeouts](#timeouts).
|
|
100
100
|
|
|
101
|
+
|
|
101
102
|
**Can I specify retries via the SDK?**
|
|
102
103
|
|
|
103
104
|
Yes, errors can be retried via the SDK — the default retry count is 2. The maximum number
|
|
@@ -292,7 +293,7 @@ response = client.task_run.with_raw_response.create(
|
|
|
292
293
|
print(response.headers.get('X-My-Header'))
|
|
293
294
|
|
|
294
295
|
task_run = response.parse()
|
|
295
|
-
print(task_run.
|
|
296
|
+
print(task_run.interaction_id)
|
|
296
297
|
```
|
|
297
298
|
|
|
298
299
|
These methods return an [`APIResponse`](https://github.com/parallel-web/parallel-sdk-python/tree/main/src/parallel/_response.py) object.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Shared Types
|
|
2
|
+
|
|
3
|
+
```python
|
|
4
|
+
from parallel.types import ErrorObject, ErrorResponse, SourcePolicy, Warning
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
# TaskRun
|
|
8
|
+
|
|
9
|
+
Types:
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from parallel.types import (
|
|
13
|
+
AutoSchema,
|
|
14
|
+
Citation,
|
|
15
|
+
FieldBasis,
|
|
16
|
+
JsonSchema,
|
|
17
|
+
ParsedTaskRunResult,
|
|
18
|
+
RunInput,
|
|
19
|
+
TaskRun,
|
|
20
|
+
TaskRunJsonOutput,
|
|
21
|
+
TaskRunResult,
|
|
22
|
+
TaskRunTextOutput,
|
|
23
|
+
TaskSpec,
|
|
24
|
+
TextSchema,
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Methods:
|
|
29
|
+
|
|
30
|
+
- <code title="post /v1/tasks/runs">client.task_run.<a href="./src/parallel/resources/task_run.py">create</a>(\*\*<a href="src/parallel/types/task_run_create_params.py">params</a>) -> <a href="./src/parallel/types/task_run.py">TaskRun</a></code>
|
|
31
|
+
- <code title="get /v1/tasks/runs/{run_id}">client.task_run.<a href="./src/parallel/resources/task_run.py">retrieve</a>(run_id) -> <a href="./src/parallel/types/task_run.py">TaskRun</a></code>
|
|
32
|
+
- <code title="get /v1/tasks/runs/{run_id}/result">client.task_run.<a href="./src/parallel/resources/task_run.py">result</a>(run_id, \*\*<a href="src/parallel/types/task_run_result_params.py">params</a>) -> <a href="./src/parallel/types/task_run_result.py">TaskRunResult</a></code>
|
|
33
|
+
|
|
34
|
+
Convenience methods:
|
|
35
|
+
|
|
36
|
+
- <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>
|
|
37
|
+
- <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>
|
|
38
|
+
# [Beta](src/parallel/resources/beta/api.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "parallel-web"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.2"
|
|
4
4
|
description = "The official Python library for the Parallel API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "MIT"
|
|
@@ -70,7 +70,7 @@ format = { chain = [
|
|
|
70
70
|
# run formatting again to fix any inconsistencies when imports are stripped
|
|
71
71
|
"format:ruff",
|
|
72
72
|
]}
|
|
73
|
-
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
|
|
73
|
+
"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'"
|
|
74
74
|
"format:ruff" = "ruff format"
|
|
75
75
|
|
|
76
76
|
"lint" = { chain = [
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
-e file:.
|
|
13
13
|
aiohappyeyeballs==2.6.1
|
|
14
14
|
# via aiohttp
|
|
15
|
-
aiohttp==3.13.
|
|
15
|
+
aiohttp==3.13.3
|
|
16
16
|
# via httpx-aiohttp
|
|
17
17
|
# via parallel-web
|
|
18
18
|
aiosignal==1.4.0
|
|
19
19
|
# via aiohttp
|
|
20
20
|
annotated-types==0.7.0
|
|
21
21
|
# via pydantic
|
|
22
|
-
anyio==4.12.
|
|
22
|
+
anyio==4.12.1
|
|
23
23
|
# via httpx
|
|
24
24
|
# via parallel-web
|
|
25
25
|
argcomplete==3.6.3
|
|
@@ -31,7 +31,7 @@ attrs==25.4.0
|
|
|
31
31
|
# via nox
|
|
32
32
|
backports-asyncio-runner==1.2.0
|
|
33
33
|
# via pytest-asyncio
|
|
34
|
-
certifi==
|
|
34
|
+
certifi==2026.1.4
|
|
35
35
|
# via httpcore
|
|
36
36
|
# via httpx
|
|
37
37
|
colorama==0.4.6
|
|
@@ -64,7 +64,7 @@ httpx==0.28.1
|
|
|
64
64
|
# via httpx-aiohttp
|
|
65
65
|
# via parallel-web
|
|
66
66
|
# via respx
|
|
67
|
-
httpx-aiohttp==0.1.
|
|
67
|
+
httpx-aiohttp==0.1.12
|
|
68
68
|
# via parallel-web
|
|
69
69
|
humanize==4.13.0
|
|
70
70
|
# via nox
|
|
@@ -72,7 +72,7 @@ idna==3.11
|
|
|
72
72
|
# via anyio
|
|
73
73
|
# via httpx
|
|
74
74
|
# via yarl
|
|
75
|
-
importlib-metadata==8.7.
|
|
75
|
+
importlib-metadata==8.7.1
|
|
76
76
|
iniconfig==2.1.0
|
|
77
77
|
# via pytest
|
|
78
78
|
markdown-it-py==3.0.0
|
|
@@ -85,14 +85,14 @@ multidict==6.7.0
|
|
|
85
85
|
mypy==1.17.0
|
|
86
86
|
mypy-extensions==1.1.0
|
|
87
87
|
# via mypy
|
|
88
|
-
nodeenv==1.
|
|
88
|
+
nodeenv==1.10.0
|
|
89
89
|
# via pyright
|
|
90
90
|
nox==2025.11.12
|
|
91
91
|
packaging==25.0
|
|
92
92
|
# via dependency-groups
|
|
93
93
|
# via nox
|
|
94
94
|
# via pytest
|
|
95
|
-
pathspec==0.
|
|
95
|
+
pathspec==1.0.3
|
|
96
96
|
# via mypy
|
|
97
97
|
platformdirs==4.4.0
|
|
98
98
|
# via virtualenv
|
|
@@ -118,13 +118,13 @@ python-dateutil==2.9.0.post0
|
|
|
118
118
|
# via time-machine
|
|
119
119
|
respx==0.22.0
|
|
120
120
|
rich==14.2.0
|
|
121
|
-
ruff==0.14.
|
|
121
|
+
ruff==0.14.13
|
|
122
122
|
six==1.17.0
|
|
123
123
|
# via python-dateutil
|
|
124
124
|
sniffio==1.3.1
|
|
125
125
|
# via parallel-web
|
|
126
126
|
time-machine==2.19.0
|
|
127
|
-
tomli==2.
|
|
127
|
+
tomli==2.4.0
|
|
128
128
|
# via dependency-groups
|
|
129
129
|
# via mypy
|
|
130
130
|
# via nox
|
|
@@ -144,7 +144,7 @@ typing-extensions==4.15.0
|
|
|
144
144
|
# via virtualenv
|
|
145
145
|
typing-inspection==0.4.2
|
|
146
146
|
# via pydantic
|
|
147
|
-
virtualenv==20.
|
|
147
|
+
virtualenv==20.36.1
|
|
148
148
|
# via nox
|
|
149
149
|
yarl==1.22.0
|
|
150
150
|
# via aiohttp
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
-e file:.
|
|
13
13
|
aiohappyeyeballs==2.6.1
|
|
14
14
|
# via aiohttp
|
|
15
|
-
aiohttp==3.13.
|
|
15
|
+
aiohttp==3.13.3
|
|
16
16
|
# via httpx-aiohttp
|
|
17
17
|
# via parallel-web
|
|
18
18
|
aiosignal==1.4.0
|
|
19
19
|
# via aiohttp
|
|
20
20
|
annotated-types==0.7.0
|
|
21
21
|
# via pydantic
|
|
22
|
-
anyio==4.12.
|
|
22
|
+
anyio==4.12.1
|
|
23
23
|
# via httpx
|
|
24
24
|
# via parallel-web
|
|
25
25
|
async-timeout==5.0.1
|
|
26
26
|
# via aiohttp
|
|
27
27
|
attrs==25.4.0
|
|
28
28
|
# via aiohttp
|
|
29
|
-
certifi==
|
|
29
|
+
certifi==2026.1.4
|
|
30
30
|
# via httpcore
|
|
31
31
|
# via httpx
|
|
32
32
|
distro==1.9.0
|
|
@@ -43,7 +43,7 @@ httpcore==1.0.9
|
|
|
43
43
|
httpx==0.28.1
|
|
44
44
|
# via httpx-aiohttp
|
|
45
45
|
# via parallel-web
|
|
46
|
-
httpx-aiohttp==0.1.
|
|
46
|
+
httpx-aiohttp==0.1.12
|
|
47
47
|
# via parallel-web
|
|
48
48
|
idna==3.11
|
|
49
49
|
# via anyio
|
|
@@ -86,6 +86,7 @@ from ._exceptions import (
|
|
|
86
86
|
APIConnectionError,
|
|
87
87
|
APIResponseValidationError,
|
|
88
88
|
)
|
|
89
|
+
from ._utils._json import openapi_dumps
|
|
89
90
|
|
|
90
91
|
log: logging.Logger = logging.getLogger(__name__)
|
|
91
92
|
|
|
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
554
555
|
kwargs["content"] = options.content
|
|
555
556
|
elif isinstance(json_data, bytes):
|
|
556
557
|
kwargs["content"] = json_data
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
elif not files:
|
|
559
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
560
|
+
# since httpx's content param overrides other body arguments
|
|
561
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
559
562
|
kwargs["files"] = files
|
|
560
563
|
else:
|
|
561
564
|
headers.pop("Content-Type", None)
|
|
@@ -104,6 +104,11 @@ class Parallel(SyncAPIClient):
|
|
|
104
104
|
|
|
105
105
|
@cached_property
|
|
106
106
|
def task_run(self) -> TaskRunResource:
|
|
107
|
+
"""The Task API executes web research and extraction tasks.
|
|
108
|
+
|
|
109
|
+
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.
|
|
110
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
111
|
+
"""
|
|
107
112
|
from .resources.task_run import TaskRunResource
|
|
108
113
|
|
|
109
114
|
return TaskRunResource(self)
|
|
@@ -284,6 +289,11 @@ class AsyncParallel(AsyncAPIClient):
|
|
|
284
289
|
|
|
285
290
|
@cached_property
|
|
286
291
|
def task_run(self) -> AsyncTaskRunResource:
|
|
292
|
+
"""The Task API executes web research and extraction tasks.
|
|
293
|
+
|
|
294
|
+
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.
|
|
295
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
296
|
+
"""
|
|
287
297
|
from .resources.task_run import AsyncTaskRunResource
|
|
288
298
|
|
|
289
299
|
return AsyncTaskRunResource(self)
|
|
@@ -415,6 +425,11 @@ class ParallelWithRawResponse:
|
|
|
415
425
|
|
|
416
426
|
@cached_property
|
|
417
427
|
def task_run(self) -> task_run.TaskRunResourceWithRawResponse:
|
|
428
|
+
"""The Task API executes web research and extraction tasks.
|
|
429
|
+
|
|
430
|
+
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.
|
|
431
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
432
|
+
"""
|
|
418
433
|
from .resources.task_run import TaskRunResourceWithRawResponse
|
|
419
434
|
|
|
420
435
|
return TaskRunResourceWithRawResponse(self._client.task_run)
|
|
@@ -434,6 +449,11 @@ class AsyncParallelWithRawResponse:
|
|
|
434
449
|
|
|
435
450
|
@cached_property
|
|
436
451
|
def task_run(self) -> task_run.AsyncTaskRunResourceWithRawResponse:
|
|
452
|
+
"""The Task API executes web research and extraction tasks.
|
|
453
|
+
|
|
454
|
+
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.
|
|
455
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
456
|
+
"""
|
|
437
457
|
from .resources.task_run import AsyncTaskRunResourceWithRawResponse
|
|
438
458
|
|
|
439
459
|
return AsyncTaskRunResourceWithRawResponse(self._client.task_run)
|
|
@@ -453,6 +473,11 @@ class ParallelWithStreamedResponse:
|
|
|
453
473
|
|
|
454
474
|
@cached_property
|
|
455
475
|
def task_run(self) -> task_run.TaskRunResourceWithStreamingResponse:
|
|
476
|
+
"""The Task API executes web research and extraction tasks.
|
|
477
|
+
|
|
478
|
+
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.
|
|
479
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
480
|
+
"""
|
|
456
481
|
from .resources.task_run import TaskRunResourceWithStreamingResponse
|
|
457
482
|
|
|
458
483
|
return TaskRunResourceWithStreamingResponse(self._client.task_run)
|
|
@@ -472,6 +497,11 @@ class AsyncParallelWithStreamedResponse:
|
|
|
472
497
|
|
|
473
498
|
@cached_property
|
|
474
499
|
def task_run(self) -> task_run.AsyncTaskRunResourceWithStreamingResponse:
|
|
500
|
+
"""The Task API executes web research and extraction tasks.
|
|
501
|
+
|
|
502
|
+
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.
|
|
503
|
+
- Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
504
|
+
"""
|
|
475
505
|
from .resources.task_run import AsyncTaskRunResourceWithStreamingResponse
|
|
476
506
|
|
|
477
507
|
return AsyncTaskRunResourceWithStreamingResponse(self._client.task_run)
|
|
@@ -139,6 +139,7 @@ def model_dump(
|
|
|
139
139
|
exclude_defaults: bool = False,
|
|
140
140
|
warnings: bool = True,
|
|
141
141
|
mode: Literal["json", "python"] = "python",
|
|
142
|
+
by_alias: bool | None = None,
|
|
142
143
|
) -> dict[str, Any]:
|
|
143
144
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
144
145
|
return model.model_dump(
|
|
@@ -148,13 +149,12 @@ def model_dump(
|
|
|
148
149
|
exclude_defaults=exclude_defaults,
|
|
149
150
|
# warnings are not supported in Pydantic v1
|
|
150
151
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
+
by_alias=by_alias,
|
|
151
153
|
)
|
|
152
154
|
return cast(
|
|
153
155
|
"dict[str, Any]",
|
|
154
156
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
155
|
-
exclude=exclude,
|
|
156
|
-
exclude_unset=exclude_unset,
|
|
157
|
-
exclude_defaults=exclude_defaults,
|
|
157
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
158
158
|
),
|
|
159
159
|
)
|
|
160
160
|
|
|
@@ -152,6 +152,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
152
152
|
),
|
|
153
153
|
response=self.http_response,
|
|
154
154
|
client=cast(Any, self._client),
|
|
155
|
+
options=self._options,
|
|
155
156
|
),
|
|
156
157
|
)
|
|
157
158
|
|
|
@@ -162,6 +163,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
162
163
|
cast_to=extract_stream_chunk_type(self._stream_cls),
|
|
163
164
|
response=self.http_response,
|
|
164
165
|
client=cast(Any, self._client),
|
|
166
|
+
options=self._options,
|
|
165
167
|
),
|
|
166
168
|
)
|
|
167
169
|
|
|
@@ -175,6 +177,7 @@ class BaseAPIResponse(Generic[R]):
|
|
|
175
177
|
cast_to=cast_to,
|
|
176
178
|
response=self.http_response,
|
|
177
179
|
client=cast(Any, self._client),
|
|
180
|
+
options=self._options,
|
|
178
181
|
),
|
|
179
182
|
)
|
|
180
183
|
|
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import json
|
|
5
5
|
import inspect
|
|
6
6
|
from types import TracebackType
|
|
7
|
-
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
|
|
8
8
|
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable
|
|
9
9
|
|
|
10
10
|
import httpx
|
|
@@ -13,6 +13,7 @@ from ._utils import extract_type_var_from_base
|
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
15
|
from ._client import Parallel, AsyncParallel
|
|
16
|
+
from ._models import FinalRequestOptions
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
_T = TypeVar("_T")
|
|
@@ -22,7 +23,7 @@ class Stream(Generic[_T]):
|
|
|
22
23
|
"""Provides the core interface to iterate over a synchronous stream response."""
|
|
23
24
|
|
|
24
25
|
response: httpx.Response
|
|
25
|
-
|
|
26
|
+
_options: Optional[FinalRequestOptions] = None
|
|
26
27
|
_decoder: SSEBytesDecoder
|
|
27
28
|
|
|
28
29
|
def __init__(
|
|
@@ -31,10 +32,12 @@ class Stream(Generic[_T]):
|
|
|
31
32
|
cast_to: type[_T],
|
|
32
33
|
response: httpx.Response,
|
|
33
34
|
client: Parallel,
|
|
35
|
+
options: Optional[FinalRequestOptions] = None,
|
|
34
36
|
) -> None:
|
|
35
37
|
self.response = response
|
|
36
38
|
self._cast_to = cast_to
|
|
37
39
|
self._client = client
|
|
40
|
+
self._options = options
|
|
38
41
|
self._decoder = client._make_sse_decoder()
|
|
39
42
|
self._iterator = self.__stream__()
|
|
40
43
|
|
|
@@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
|
|
|
85
88
|
"""Provides the core interface to iterate over an asynchronous stream response."""
|
|
86
89
|
|
|
87
90
|
response: httpx.Response
|
|
88
|
-
|
|
91
|
+
_options: Optional[FinalRequestOptions] = None
|
|
89
92
|
_decoder: SSEDecoder | SSEBytesDecoder
|
|
90
93
|
|
|
91
94
|
def __init__(
|
|
@@ -94,10 +97,12 @@ class AsyncStream(Generic[_T]):
|
|
|
94
97
|
cast_to: type[_T],
|
|
95
98
|
response: httpx.Response,
|
|
96
99
|
client: AsyncParallel,
|
|
100
|
+
options: Optional[FinalRequestOptions] = None,
|
|
97
101
|
) -> None:
|
|
98
102
|
self.response = response
|
|
99
103
|
self._cast_to = cast_to
|
|
100
104
|
self._client = client
|
|
105
|
+
self._options = options
|
|
101
106
|
self._decoder = client._make_sse_decoder()
|
|
102
107
|
self._iterator = self.__stream__()
|
|
103
108
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
# Shared Types
|
|
2
|
-
|
|
3
|
-
```python
|
|
4
|
-
from parallel.types import ErrorObject, ErrorResponse, SourcePolicy, Warning
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
# TaskRun
|
|
8
|
-
|
|
9
|
-
Types:
|
|
10
|
-
|
|
11
|
-
```python
|
|
12
|
-
from parallel.types import (
|
|
13
|
-
AutoSchema,
|
|
14
|
-
Citation,
|
|
15
|
-
FieldBasis,
|
|
16
|
-
JsonSchema,
|
|
17
|
-
ParsedTaskRunResult,
|
|
18
|
-
RunInput,
|
|
19
|
-
TaskRun,
|
|
20
|
-
TaskRunJsonOutput,
|
|
21
|
-
TaskRunResult,
|
|
22
|
-
TaskRunTextOutput,
|
|
23
|
-
TaskSpec,
|
|
24
|
-
TextSchema,
|
|
25
|
-
)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Methods:
|
|
29
|
-
|
|
30
|
-
- <code title="post /v1/tasks/runs">client.task_run.<a href="./src/parallel/resources/task_run.py">create</a>(\*\*<a href="src/parallel/types/task_run_create_params.py">params</a>) -> <a href="./src/parallel/types/task_run.py">TaskRun</a></code>
|
|
31
|
-
- <code title="get /v1/tasks/runs/{run_id}">client.task_run.<a href="./src/parallel/resources/task_run.py">retrieve</a>(run_id) -> <a href="./src/parallel/types/task_run.py">TaskRun</a></code>
|
|
32
|
-
- <code title="get /v1/tasks/runs/{run_id}/result">client.task_run.<a href="./src/parallel/resources/task_run.py">result</a>(run_id, \*\*<a href="src/parallel/types/task_run_result_params.py">params</a>) -> <a href="./src/parallel/types/task_run_result.py">TaskRunResult</a></code>
|
|
33
|
-
|
|
34
|
-
Convenience methods:
|
|
35
|
-
|
|
36
|
-
- <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>
|
|
37
|
-
- <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>
|
|
38
1
|
# Beta
|
|
39
2
|
|
|
40
3
|
Types:
|