Skip to content

Commit 04b0797

Browse files
fix: change organization.name to replicate
What will happen? Let's find out...
1 parent b2a0246 commit 04b0797

32 files changed

+445
-453
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
run: |
2929
bash ./bin/publish-pypi
3030
env:
31-
PYPI_TOKEN: ${{ secrets.REPLICATE_CLIENT_PYPI_TOKEN || secrets.PYPI_TOKEN }}
31+
PYPI_TOKEN: ${{ secrets.REPLICATE_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21-
PYPI_TOKEN: ${{ secrets.REPLICATE_CLIENT_PYPI_TOKEN || secrets.PYPI_TOKEN }}
21+
PYPI_TOKEN: ${{ secrets.REPLICATE_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-0d7d82bff8a18b03e0cd1cbf8609c3026bb07db851bc6f9166032045a9925eea.yml
33
openapi_spec_hash: 8ce211dfa6fece24b1413e91ba55210a
4-
config_hash: 2e6a171ce57a4a6a8e8dcd3dd893d8cc
4+
config_hash: c784c102324b1d027c6ce40e17fe9590

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Replicate Client
189+
Copyright 2025 Replicate
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Replicate Client Python API library
1+
# Replicate Python API library
22

33
[![PyPI version](https://img.shields.io/pypi/v/replicate-stainless.svg)](https://pypi.org/project/replicate-stainless/)
44

5-
The Replicate Client Python library provides convenient access to the Replicate Client REST API from any Python 3.8+
5+
The Replicate Python library provides convenient access to the Replicate REST API from any Python 3.8+
66
application. The library includes type definitions for all request params and response fields,
77
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
88

@@ -25,9 +25,9 @@ The full API of this library can be found in [api.md](api.md).
2525

2626
```python
2727
import os
28-
from replicate import ReplicateClient
28+
from replicate import Replicate
2929

30-
client = ReplicateClient(
30+
client = Replicate(
3131
bearer_token=os.environ.get("REPLICATE_API_TOKEN"), # This is the default and can be omitted
3232
)
3333

@@ -42,14 +42,14 @@ so that your Bearer Token is not stored in source control.
4242

4343
## Async usage
4444

45-
Simply import `AsyncReplicateClient` instead of `ReplicateClient` and use `await` with each API call:
45+
Simply import `AsyncReplicate` instead of `Replicate` and use `await` with each API call:
4646

4747
```python
4848
import os
4949
import asyncio
50-
from replicate import AsyncReplicateClient
50+
from replicate import AsyncReplicate
5151

52-
client = AsyncReplicateClient(
52+
client = AsyncReplicate(
5353
bearer_token=os.environ.get("REPLICATE_API_TOKEN"), # This is the default and can be omitted
5454
)
5555

@@ -75,14 +75,14 @@ Typed requests and responses provide autocomplete and documentation within your
7575

7676
## Pagination
7777

78-
List methods in the Replicate Client API are paginated.
78+
List methods in the Replicate API are paginated.
7979

8080
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
8181

8282
```python
83-
from replicate import ReplicateClient
83+
from replicate import Replicate
8484

85-
client = ReplicateClient()
85+
client = Replicate()
8686

8787
all_predictions = []
8888
# Automatically fetches more pages as needed.
@@ -96,9 +96,9 @@ Or, asynchronously:
9696

9797
```python
9898
import asyncio
99-
from replicate import AsyncReplicateClient
99+
from replicate import AsyncReplicate
100100

101-
client = AsyncReplicateClient()
101+
client = AsyncReplicate()
102102

103103

104104
async def main() -> None:
@@ -147,9 +147,9 @@ All errors inherit from `replicate.APIError`.
147147

148148
```python
149149
import replicate
150-
from replicate import ReplicateClient
150+
from replicate import Replicate
151151

152-
client = ReplicateClient()
152+
client = Replicate()
153153

154154
try:
155155
client.account.get()
@@ -186,10 +186,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
186186
You can use the `max_retries` option to configure or disable retry settings:
187187

188188
```python
189-
from replicate import ReplicateClient
189+
from replicate import Replicate
190190

191191
# Configure the default for all requests:
192-
client = ReplicateClient(
192+
client = Replicate(
193193
# default is 2
194194
max_retries=0,
195195
)
@@ -204,16 +204,16 @@ By default requests time out after 1 minute. You can configure this with a `time
204204
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
205205

206206
```python
207-
from replicate import ReplicateClient
207+
from replicate import Replicate
208208

209209
# Configure the default for all requests:
210-
client = ReplicateClient(
210+
client = Replicate(
211211
# 20 seconds (default is 1 minute)
212212
timeout=20.0,
213213
)
214214

215215
# More granular control:
216-
client = ReplicateClient(
216+
client = Replicate(
217217
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
218218
)
219219

@@ -231,10 +231,10 @@ Note that requests that time out are [retried twice by default](#retries).
231231

232232
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
233233

234-
You can enable logging by setting the environment variable `REPLICATE_CLIENT_LOG` to `info`.
234+
You can enable logging by setting the environment variable `REPLICATE_LOG` to `info`.
235235

236236
```shell
237-
$ export REPLICATE_CLIENT_LOG=info
237+
$ export REPLICATE_LOG=info
238238
```
239239

240240
Or to `debug` for more verbose logging.
@@ -256,9 +256,9 @@ if response.my_field is None:
256256
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
257257

258258
```py
259-
from replicate import ReplicateClient
259+
from replicate import Replicate
260260

261-
client = ReplicateClient()
261+
client = Replicate()
262262
response = client.account.with_raw_response.get()
263263
print(response.headers.get('X-My-Header'))
264264

@@ -330,10 +330,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
330330

331331
```python
332332
import httpx
333-
from replicate import ReplicateClient, DefaultHttpxClient
333+
from replicate import Replicate, DefaultHttpxClient
334334

335-
client = ReplicateClient(
336-
# Or use the `REPLICATE_CLIENT_BASE_URL` env var
335+
client = Replicate(
336+
# Or use the `REPLICATE_BASE_URL` env var
337337
base_url="http://my.test.server.example.com:8083",
338338
http_client=DefaultHttpxClient(
339339
proxy="http://my.test.proxy.example.com",
@@ -353,9 +353,9 @@ client.with_options(http_client=DefaultHttpxClient(...))
353353
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
354354

355355
```py
356-
from replicate import ReplicateClient
356+
from replicate import Replicate
357357

358-
with ReplicateClient() as client:
358+
with Replicate() as client:
359359
# make requests here
360360
...
361361

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Replicate Client please follow the respective company's security reporting guidelines.
19+
or products provided by Replicate please follow the respective company's security reporting guidelines.
2020

21-
### Replicate Client Terms and Policies
21+
### Replicate Terms and Policies
2222

2323
Please contact [email protected] for any questions or concerns regarding security of our services.
2424

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

55
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The REPLICATE_CLIENT_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
6+
errors+=("The REPLICATE_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
77
fi
88

99
lenErrors=${#errors[@]}

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "replicate-stainless"
33
version = "0.1.0-alpha.8"
4-
description = "The official Python library for the replicate-client API"
4+
description = "The official Python library for the replicate API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
77
authors = [
8-
{ name = "Replicate Client", email = "[email protected]" },
8+
{ name = "Replicate", email = "[email protected]" },
99
]
1010
dependencies = [
1111
"httpx>=0.23.0, <1",

src/replicate/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
Client,
1212
Stream,
1313
Timeout,
14+
Replicate,
1415
Transport,
1516
AsyncClient,
1617
AsyncStream,
18+
AsyncReplicate,
1719
RequestOptions,
18-
ReplicateClient,
19-
AsyncReplicateClient,
2020
)
2121
from ._models import BaseModel
2222
from ._version import __title__, __version__
@@ -28,12 +28,12 @@
2828
NotFoundError,
2929
APIStatusError,
3030
RateLimitError,
31+
ReplicateError,
3132
APITimeoutError,
3233
BadRequestError,
3334
APIConnectionError,
3435
AuthenticationError,
3536
InternalServerError,
36-
ReplicateClientError,
3737
PermissionDeniedError,
3838
UnprocessableEntityError,
3939
APIResponseValidationError,
@@ -51,7 +51,7 @@
5151
"NotGiven",
5252
"NOT_GIVEN",
5353
"Omit",
54-
"ReplicateClientError",
54+
"ReplicateError",
5555
"APIError",
5656
"APIStatusError",
5757
"APITimeoutError",
@@ -71,8 +71,8 @@
7171
"AsyncClient",
7272
"Stream",
7373
"AsyncStream",
74-
"ReplicateClient",
75-
"AsyncReplicateClient",
74+
"Replicate",
75+
"AsyncReplicate",
7676
"file_from_path",
7777
"BaseModel",
7878
"DEFAULT_TIMEOUT",
@@ -119,7 +119,7 @@
119119
http_client: _httpx.Client | None = None
120120

121121

122-
class _ModuleClient(ReplicateClient):
122+
class _ModuleClient(Replicate):
123123
# Note: we have to use type: ignores here as overriding class members
124124
# with properties is technically unsafe but it is fine for our use case
125125

@@ -202,10 +202,10 @@ def _client(self, value: _httpx.Client) -> None: # type: ignore
202202
http_client = value
203203

204204

205-
_client: ReplicateClient | None = None
205+
_client: Replicate | None = None
206206

207207

208-
def _load_client() -> ReplicateClient: # type: ignore[reportUnusedFunction]
208+
def _load_client() -> Replicate: # type: ignore[reportUnusedFunction]
209209
global _client
210210

211211
if _client is None:

0 commit comments

Comments
 (0)