You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,26 @@
1
1
# Changelog
2
2
3
+
## 2.0.0-alpha.5 (2025-06-25)
4
+
5
+
Full Changelog: [v2.0.0-alpha.4...v2.0.0-alpha.5](https://github.com/replicate/replicate-python-stainless/compare/v2.0.0-alpha.4...v2.0.0-alpha.5)
6
+
7
+
### Features
8
+
9
+
***api:** api update ([6e667da](https://github.com/replicate/replicate-python-stainless/commit/6e667da6c2e80add847e612bbd08db1c865793d7))
10
+
***api:** api update ([0a187a9](https://github.com/replicate/replicate-python-stainless/commit/0a187a9ba906c0bc5c4e658883266276fc357665))
11
+
***api:** api update ([edb14b6](https://github.com/replicate/replicate-python-stainless/commit/edb14b65c61203c2e42a1accd384e7b456e33448))
12
+
***client:** add support for aiohttp ([c802a30](https://github.com/replicate/replicate-python-stainless/commit/c802a30a0569cb25eb700ff5501c5a87291ef4b0))
13
+
14
+
15
+
### Chores
16
+
17
+
***tests:** skip some failing tests on the latest python versions ([d331b72](https://github.com/replicate/replicate-python-stainless/commit/d331b72364eaed6f935f9b23fdc776303ebf57a6))
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,42 @@ asyncio.run(main())
68
68
69
69
Functionality between the synchronous and asynchronous clients is otherwise identical.
70
70
71
+
### With aiohttp
72
+
73
+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
74
+
75
+
You can enable this by installing `aiohttp`:
76
+
77
+
```sh
78
+
# install from PyPI
79
+
pip install --pre replicate[aiohttp]
80
+
```
81
+
82
+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
83
+
84
+
```python
85
+
import os
86
+
import asyncio
87
+
from replicate import DefaultAioHttpClient
88
+
from replicate import AsyncReplicate
89
+
90
+
91
+
asyncdefmain() -> None:
92
+
asyncwith AsyncReplicate(
93
+
bearer_token=os.environ.get(
94
+
"REPLICATE_API_TOKEN"
95
+
), # This is the default and can be omitted
96
+
http_client=DefaultAioHttpClient(),
97
+
) as replicate:
98
+
prediction =await replicate.predictions.get(
99
+
prediction_id="gm3qorzdhgbfurvjtvhg6dckhu",
100
+
)
101
+
print(prediction.id)
102
+
103
+
104
+
asyncio.run(main())
105
+
```
106
+
71
107
## Using types
72
108
73
109
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:
0 commit comments