Skip to content

Commit 043cd0b

Browse files
release: 1.0.1 (#28)
Automated Release PR --- ## 1.0.1 (2026-06-03) Full Changelog: [v1.0.0...v1.0.1](v1.0.0...v1.0.1) ### Chores * remove undocumented backwards-compat alias shims ([e5a2ad8](e5a2ad8)) * **types:** drop redundant NotRequired on task_spec input_schema ([b356c22](b356c22)) ### Documentation * regenerate api.md from spec (drop hand-maintained patch) ([05d2897](05d2897)) * regenerate README from spec (drop hand-maintained patch) ([c7ed169](c7ed169)) --- This pull request is managed by Stainless's [GitHub App](https://github.com/apps/stainless-app). The [semver version number](https://semver.org/#semantic-versioning-specification-semver) is based on included [commit messages](https://www.conventionalcommits.org/en/v1.0.0/). Alternatively, you can manually set the version number in the title of this pull request. For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request. 🔗 Stainless [website](https://www.stainlessapi.com) 📚 Read the [docs](https://app.stainlessapi.com/docs) 🙋 [Reach out](mailto:support@stainlessapi.com) for help or questions --------- Co-authored-by: Matt Harris <mharris@parallel.ai> Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 3d68b23 commit 043cd0b

29 files changed

Lines changed: 111 additions & 322 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.0"
2+
".": "1.0.1"
33
}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 1.0.1 (2026-06-03)
4+
5+
Full Changelog: [v1.0.0...v1.0.1](https://github.com/parallel-web/parallel-sdk-python/compare/v1.0.0...v1.0.1)
6+
7+
### Chores
8+
9+
* remove undocumented backwards-compat alias shims ([e5a2ad8](https://github.com/parallel-web/parallel-sdk-python/commit/e5a2ad80cdd6e4f708c3ec05c9df8b8ede79a772))
10+
* **types:** drop redundant NotRequired on task_spec input_schema ([b356c22](https://github.com/parallel-web/parallel-sdk-python/commit/b356c22e718ab1a95a40b6b37917a5b8bcbb091a))
11+
12+
13+
### Documentation
14+
15+
* regenerate api.md from spec (drop hand-maintained patch) ([05d2897](https://github.com/parallel-web/parallel-sdk-python/commit/05d28970ff8b3efc77b1c4ef60beecc654a52385))
16+
* regenerate README from spec (drop hand-maintained patch) ([c7ed169](https://github.com/parallel-web/parallel-sdk-python/commit/c7ed169c66a60485b309147fb7aa1b6d2e551766))
17+
318
## 1.0.0 (2026-06-02)
419

520
Full Changelog: [v0.6.0...v1.0.0](https://github.com/parallel-web/parallel-sdk-python/compare/v0.6.0...v1.0.0)

README.md

Lines changed: 68 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
The Parallel Python library provides convenient access to the Parallel REST API from any Python 3.9+
77
application. The library includes type definitions for all request params and response fields,
88
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
9-
It is strongly encouraged to use the asynchronous client for best performance.
109

1110
It is generated with [Stainless](https://www.stainless.com/).
1211

1312
## Documentation
1413

15-
The REST API documentation can be found in our [docs](https://docs.parallel.ai).
16-
The full API of this Python library can be found in [api.md](api.md).
14+
The REST API documentation can be found on [docs.parallel.ai](https://docs.parallel.ai). The full API of this library can be found in [api.md](api.md).
1715

1816
## Installation
1917

@@ -35,23 +33,17 @@ client = Parallel(
3533
)
3634

3735
task_run = client.task_run.create(
38-
input="France (2023)",
39-
processor="core",
36+
input="What was the GDP of France in 2023?",
37+
processor="base",
4038
)
41-
task_run_result = client.task_run.result(run_id=task_run.run_id)
42-
print(task_run_result.output)
39+
print(task_run.interaction_id)
4340
```
4441

4542
While you can provide an `api_key` keyword argument,
4643
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
4744
to add `PARALLEL_API_KEY="My API Key"` to your `.env` file
4845
so that your API Key is not stored in source control.
4946

50-
The API also supports typed inputs and outputs via Pydantic objects. See the relevant
51-
section on [convenience methods](#convenience-methods).
52-
53-
For information on what tasks are and how to specify them, see [our docs](https://docs.parallel.ai/task-api/core-concepts/specify-a-task).
54-
5547
## Async usage
5648

5749
Simply import `AsyncParallel` instead of `Parallel` and use `await` with each API call:
@@ -67,102 +59,79 @@ client = AsyncParallel(
6759

6860

6961
async def main() -> None:
70-
task_run = await client.task_run.create(input="France (2023)", processor="core")
71-
run_result = await client.task_run.result(run_id=task_run.run_id)
72-
print(run_result.output.content)
62+
task_run = await client.task_run.create(
63+
input="What was the GDP of France in 2023?",
64+
processor="base",
65+
)
66+
print(task_run.interaction_id)
7367

7468

75-
if __name__ == "__main__":
76-
asyncio.run(main())
69+
asyncio.run(main())
7770
```
7871

79-
To get the best performance out of Parallel's API, we recommend
80-
using the asynchronous client, especially for executing multiple Task Runs concurrently.
81-
Functionality between the synchronous and asynchronous clients is identical, including
82-
the convenience methods.
72+
Functionality between the synchronous and asynchronous clients is otherwise identical.
8373

84-
## Frequently Asked Questions
74+
### With aiohttp
8575

86-
**Does the Task API accept prompts or objectives?**
76+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
8777

88-
No, there are no `objective` or `prompt` parameters that can be specified for calls to
89-
the Task API. Instead, provide any directives or instructions via the schemas. For
90-
more information, check [our docs](https://docs.parallel.ai/task-api/core-concepts/specify-a-task).
78+
You can enable this by installing `aiohttp`:
9179

92-
**Can I access beta parameters or endpoints via the SDK?**
80+
```sh
81+
# install from PyPI
82+
pip install parallel-web[aiohttp]
83+
```
9384

94-
Yes, the SDK supports both beta endpoints and beta header parameters for the Task API.
95-
All beta parameters are accessible via the `client.beta` namespace in the SDK.
85+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
9686

97-
**Can I specify a timeout for API calls?**
87+
```python
88+
import os
89+
import asyncio
90+
from parallel import DefaultAioHttpClient
91+
from parallel import AsyncParallel
9892

99-
Yes, all methods support a timeout. For more information, see [Timeouts](#timeouts).
10093

94+
async def main() -> None:
95+
async with AsyncParallel(
96+
api_key=os.environ.get("PARALLEL_API_KEY"), # This is the default and can be omitted
97+
http_client=DefaultAioHttpClient(),
98+
) as client:
99+
task_run = await client.task_run.create(
100+
input="What was the GDP of France in 2023?",
101+
processor="base",
102+
)
103+
print(task_run.interaction_id)
104+
105+
106+
asyncio.run(main())
107+
```
108+
109+
## Using types
101110

102-
**Can I specify retries via the SDK?**
111+
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
103112

104-
Yes, errors can be retried via the SDK — the default retry count is 2. The maximum number
105-
of retries can be configured at the client level. For information on which errors
106-
are automatically retried and how to configure retry settings, see [Retries](#retries).
113+
- Serializing back into JSON, `model.to_json()`
114+
- Converting to a dictionary, `model.to_dict()`
107115

108-
## Low‑level API access
116+
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
109117

110-
The library also provides low‑level access to the Parallel API.
118+
## Nested params
119+
120+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
111121

112122
```python
113123
from parallel import Parallel
114-
from parallel.types import TaskSpecParam
115124

116125
client = Parallel()
117126

118127
task_run = client.task_run.create(
119-
input={"country": "France", "year": 2023},
120-
processor="core",
121-
task_spec={
122-
"output_schema": {
123-
"json_schema": {
124-
"additionalProperties": False,
125-
"properties": {
126-
"gdp": {
127-
"description": "GDP in USD for the year",
128-
"type": "string",
129-
}
130-
},
131-
"required": ["gdp"],
132-
"type": "object",
133-
},
134-
"type": "json",
135-
},
136-
"input_schema": {
137-
"json_schema": {
138-
"additionalProperties": False,
139-
"properties": {
140-
"country": {
141-
"description": "Name of the country to research",
142-
"type": "string",
143-
},
144-
"year": {
145-
"description": "Year for which to retrieve information",
146-
"type": "integer",
147-
},
148-
},
149-
"required": ["country", "year"],
150-
"type": "object",
151-
},
152-
"type": "json",
153-
},
154-
},
128+
input="What was the GDP of France in 2023?",
129+
processor="base",
130+
advanced_settings={},
155131
)
156-
157-
run_result = client.task_run.result(task_run.run_id)
158-
print(run_result.output.content)
132+
print(task_run.advanced_settings)
159133
```
160134

161-
For more information, please check out the relevant section in our docs:
162-
163-
- [Task Spec](https://docs.parallel.ai/task-api/core-concepts/specify-a-task)
164-
- [Task Runs](https://docs.parallel.ai/task-api/core-concepts/execute-task-run)
165-
166135
## Handling errors
167136

168137
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `parallel.APIConnectionError` is raised.
@@ -179,7 +148,10 @@ from parallel import Parallel
179148
client = Parallel()
180149

181150
try:
182-
client.task_run.create(input="France (2023)", processor="core")
151+
client.task_run.create(
152+
input="What was the GDP of France in 2023?",
153+
processor="base",
154+
)
183155
except parallel.APIConnectionError as e:
184156
print("The server could not be reached")
185157
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -222,7 +194,10 @@ client = Parallel(
222194
)
223195

224196
# Or, configure per-request:
225-
client.with_options(max_retries=5).task_run.create(input="France (2023)", processor="core")
197+
client.with_options(max_retries=5).task_run.create(
198+
input="What was the GDP of France in 2023?",
199+
processor="base",
200+
)
226201
```
227202

228203
### Timeouts
@@ -245,7 +220,10 @@ client = Parallel(
245220
)
246221

247222
# Override per-request:
248-
client.with_options(timeout=5.0).task_run.create(input="France (2023)", processor="core")
223+
client.with_options(timeout=5.0).task_run.create(
224+
input="What was the GDP of France in 2023?",
225+
processor="base",
226+
)
249227
```
250228

251229
On timeout, an `APITimeoutError` is thrown.
@@ -287,12 +265,12 @@ from parallel import Parallel
287265

288266
client = Parallel()
289267
response = client.task_run.with_raw_response.create(
290-
input="France (2023)",
291-
processor="core",
268+
input="What was the GDP of France in 2023?",
269+
processor="base",
292270
)
293271
print(response.headers.get('X-My-Header'))
294272

295-
task_run = response.parse()
273+
task_run = response.parse() # get the object that `task_run.create()` would have returned
296274
print(task_run.interaction_id)
297275
```
298276

@@ -308,7 +286,8 @@ To stream the response body, use `.with_streaming_response` instead, which requi
308286

309287
```python
310288
with client.task_run.with_streaming_response.create(
311-
input="France (2023)", processor="core"
289+
input="What was the GDP of France in 2023?",
290+
processor="base",
312291
) as response:
313292
print(response.headers.get("X-My-Header"))
314293

api.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ Types:
3737
from parallel.types import (
3838
AutoSchema,
3939
Citation,
40+
ErrorEvent,
4041
FieldBasis,
4142
JsonSchema,
42-
ParsedTaskRunResult,
43+
McpServer,
44+
McpToolCall,
4345
RunInput,
4446
TaskAdvancedSettings,
4547
TaskRun,
48+
TaskRunEvent,
4649
TaskRunJsonOutput,
4750
TaskRunProgressMessageEvent,
4851
TaskRunProgressStatsEvent,
@@ -51,20 +54,19 @@ from parallel.types import (
5154
TaskRunTextOutput,
5255
TaskSpec,
5356
TextSchema,
57+
Webhook,
58+
TaskRunEventsResponse,
5459
)
5560
```
5661

5762
Methods:
5863

5964
- <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>
6065
- <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>
66+
- <code title="get /v1/tasks/runs/{run_id}/events">client.task_run.<a href="./src/parallel/resources/task_run.py">events</a>(run_id) -> <a href="./src/parallel/types/task_run_events_response.py">TaskRunEventsResponse</a></code>
6167
- <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>
6268
- <code title="get /v1/tasks/runs/{run_id}/input">client.task_run.<a href="./src/parallel/resources/task_run.py">retrieve_input</a>(run_id) -> <a href="./src/parallel/types/run_input.py">RunInput</a></code>
6369

64-
Convenience methods:
65-
66-
- <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>
67-
- <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>
6870
# TaskGroup
6971

7072
Types:

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "parallel-web"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "The official Python library for the Parallel API"
55
dynamic = ["readme"]
66
license = "MIT"
@@ -158,11 +158,6 @@ reportOverlappingOverload = false
158158

159159
reportImportCycles = false
160160
reportPrivateUsage = false
161-
# Deprecation is a runtime concern; type-check warnings produce noise when the
162-
# breaking-change detector compares against pre-deprecation baseline tests.
163-
# Newly-generated tests already add a per-file `# pyright: reportDeprecated=false`
164-
# marker for deprecated resources, so this just promotes that to project-level.
165-
reportDeprecated = false
166161

167162
[tool.mypy]
168163
pretty = true

0 commit comments

Comments
 (0)