Skip to content

Commit b75d713

Browse files
authored
Merge pull request #8 from replicate/release-please--branches--main--changes--next
release: 0.1.0-alpha.6
2 parents 5656ef3 + c122995 commit b75d713

File tree

18 files changed

+139
-124
lines changed

18 files changed

+139
-124
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
9-
- next
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
1010

1111
jobs:
1212
lint:
1313
timeout-minutes: 10
1414
name: lint
15-
runs-on: ubuntu-latest
15+
runs-on: ${{ github.repository == 'stainless-sdks/replicate-client-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
1616
steps:
1717
- uses: actions/checkout@v4
1818

@@ -33,7 +33,7 @@ jobs:
3333
test:
3434
timeout-minutes: 10
3535
name: test
36-
runs-on: ubuntu-latest
36+
runs-on: ${{ github.repository == 'stainless-sdks/replicate-client-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
3737
steps:
3838
- uses: actions/checkout@v4
3939

.release-please-manifest.json

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

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-2788217b7ad7d61d1a77800bc5ff12a6810f1692d4d770b72fa8f898c6a055ab.yml
33
openapi_spec_hash: 4423bf747e228484547b441468a9f156
4-
config_hash: d820945093fc56fea6d062c90745d7a5
4+
config_hash: e9a36632894b8541a86a71420dd3d0b7

CHANGELOG.md

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

3+
## 0.1.0-alpha.6 (2025-04-24)
4+
5+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/replicate/replicate-python-stainless/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
6+
7+
### Bug Fixes
8+
9+
* correct mapping for account.get ([e501778](https://github.com/replicate/replicate-python-stainless/commit/e501778a22c481147fbe419803a3f52ac9ba8243))
10+
11+
12+
### Chores
13+
14+
* broadly detect json family of content-type headers ([eeaa507](https://github.com/replicate/replicate-python-stainless/commit/eeaa5071ed47e31264a268d9445fe8c0b8d059b1))
15+
* **ci:** only use depot for staging repos ([f7ec0b8](https://github.com/replicate/replicate-python-stainless/commit/f7ec0b8e11782aa89eee5f4af962158b665eee13))
16+
* **internal:** codegen related update ([fd43800](https://github.com/replicate/replicate-python-stainless/commit/fd43800c1da9a5c6ff06309a6c4a6a3808decff9))
17+
318
## 0.1.0-alpha.5 (2025-04-24)
419

520
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/replicate/replicate-python-stainless/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ client = ReplicateClient(
3131
bearer_token=os.environ.get("REPLICATE_API_TOKEN"), # This is the default and can be omitted
3232
)
3333

34-
accounts = client.accounts.list()
35-
print(accounts.type)
34+
account = client.account.get()
35+
print(account.type)
3636
```
3737

3838
While you can provide a `bearer_token` keyword argument,
@@ -55,8 +55,8 @@ client = AsyncReplicateClient(
5555

5656

5757
async def main() -> None:
58-
accounts = await client.accounts.list()
59-
print(accounts.type)
58+
account = await client.account.get()
59+
print(account.type)
6060

6161

6262
asyncio.run(main())
@@ -152,7 +152,7 @@ from replicate import ReplicateClient
152152
client = ReplicateClient()
153153

154154
try:
155-
client.accounts.list()
155+
client.account.get()
156156
except replicate.APIConnectionError as e:
157157
print("The server could not be reached")
158158
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -195,7 +195,7 @@ client = ReplicateClient(
195195
)
196196

197197
# Or, configure per-request:
198-
client.with_options(max_retries=5).accounts.list()
198+
client.with_options(max_retries=5).account.get()
199199
```
200200

201201
### Timeouts
@@ -218,7 +218,7 @@ client = ReplicateClient(
218218
)
219219

220220
# Override per-request:
221-
client.with_options(timeout=5.0).accounts.list()
221+
client.with_options(timeout=5.0).account.get()
222222
```
223223

224224
On timeout, an `APITimeoutError` is thrown.
@@ -259,10 +259,10 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
259259
from replicate import ReplicateClient
260260

261261
client = ReplicateClient()
262-
response = client.accounts.with_raw_response.list()
262+
response = client.account.with_raw_response.get()
263263
print(response.headers.get('X-My-Header'))
264264

265-
account = response.parse() # get the object that `accounts.list()` would have returned
265+
account = response.parse() # get the object that `account.get()` would have returned
266266
print(account.type)
267267
```
268268

@@ -277,7 +277,7 @@ The above interface eagerly reads the full response body when you make the reque
277277
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
278278

279279
```python
280-
with client.accounts.with_streaming_response.list() as response:
280+
with client.account.with_streaming_response.get() as response:
281281
print(response.headers.get("X-My-Header"))
282282

283283
for line in response.iter_lines():

api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ Methods:
4444

4545
- <code title="get /hardware">client.hardware.<a href="./src/replicate/resources/hardware.py">list</a>() -> <a href="./src/replicate/types/hardware_list_response.py">HardwareListResponse</a></code>
4646

47-
# Accounts
47+
# Account
4848

4949
Types:
5050

5151
```python
52-
from replicate.types import AccountListResponse
52+
from replicate.types import AccountGetResponse
5353
```
5454

5555
Methods:
5656

57-
- <code title="get /account">client.accounts.<a href="./src/replicate/resources/accounts.py">list</a>() -> <a href="./src/replicate/types/account_list_response.py">AccountListResponse</a></code>
57+
- <code title="get /account">client.account.<a href="./src/replicate/resources/account.py">get</a>() -> <a href="./src/replicate/types/account_get_response.py">AccountGetResponse</a></code>
5858

5959
# Models
6060

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "replicate-stainless"
3-
version = "0.1.0-alpha.5"
3+
version = "0.1.0-alpha.6"
44
description = "The official Python library for the replicate-client API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/replicate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _reset_client() -> None: # type: ignore[reportUnusedFunction]
231231

232232
from ._module_client import (
233233
models as models,
234-
accounts as accounts,
234+
account as account,
235235
hardware as hardware,
236236
webhooks as webhooks,
237237
trainings as trainings,

src/replicate/_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import accounts, hardware, trainings, collections, predictions
24+
from .resources import account, hardware, trainings, collections, predictions
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import APIStatusError, ReplicateClientError
2727
from ._base_client import (
@@ -49,7 +49,7 @@ class ReplicateClient(SyncAPIClient):
4949
collections: collections.CollectionsResource
5050
deployments: deployments.DeploymentsResource
5151
hardware: hardware.HardwareResource
52-
accounts: accounts.AccountsResource
52+
account: account.AccountResource
5353
models: models.ModelsResource
5454
predictions: predictions.PredictionsResource
5555
trainings: trainings.TrainingsResource
@@ -114,7 +114,7 @@ def __init__(
114114
self.collections = collections.CollectionsResource(self)
115115
self.deployments = deployments.DeploymentsResource(self)
116116
self.hardware = hardware.HardwareResource(self)
117-
self.accounts = accounts.AccountsResource(self)
117+
self.account = account.AccountResource(self)
118118
self.models = models.ModelsResource(self)
119119
self.predictions = predictions.PredictionsResource(self)
120120
self.trainings = trainings.TrainingsResource(self)
@@ -231,7 +231,7 @@ class AsyncReplicateClient(AsyncAPIClient):
231231
collections: collections.AsyncCollectionsResource
232232
deployments: deployments.AsyncDeploymentsResource
233233
hardware: hardware.AsyncHardwareResource
234-
accounts: accounts.AsyncAccountsResource
234+
account: account.AsyncAccountResource
235235
models: models.AsyncModelsResource
236236
predictions: predictions.AsyncPredictionsResource
237237
trainings: trainings.AsyncTrainingsResource
@@ -296,7 +296,7 @@ def __init__(
296296
self.collections = collections.AsyncCollectionsResource(self)
297297
self.deployments = deployments.AsyncDeploymentsResource(self)
298298
self.hardware = hardware.AsyncHardwareResource(self)
299-
self.accounts = accounts.AsyncAccountsResource(self)
299+
self.account = account.AsyncAccountResource(self)
300300
self.models = models.AsyncModelsResource(self)
301301
self.predictions = predictions.AsyncPredictionsResource(self)
302302
self.trainings = trainings.AsyncTrainingsResource(self)
@@ -414,7 +414,7 @@ def __init__(self, client: ReplicateClient) -> None:
414414
self.collections = collections.CollectionsResourceWithRawResponse(client.collections)
415415
self.deployments = deployments.DeploymentsResourceWithRawResponse(client.deployments)
416416
self.hardware = hardware.HardwareResourceWithRawResponse(client.hardware)
417-
self.accounts = accounts.AccountsResourceWithRawResponse(client.accounts)
417+
self.account = account.AccountResourceWithRawResponse(client.account)
418418
self.models = models.ModelsResourceWithRawResponse(client.models)
419419
self.predictions = predictions.PredictionsResourceWithRawResponse(client.predictions)
420420
self.trainings = trainings.TrainingsResourceWithRawResponse(client.trainings)
@@ -426,7 +426,7 @@ def __init__(self, client: AsyncReplicateClient) -> None:
426426
self.collections = collections.AsyncCollectionsResourceWithRawResponse(client.collections)
427427
self.deployments = deployments.AsyncDeploymentsResourceWithRawResponse(client.deployments)
428428
self.hardware = hardware.AsyncHardwareResourceWithRawResponse(client.hardware)
429-
self.accounts = accounts.AsyncAccountsResourceWithRawResponse(client.accounts)
429+
self.account = account.AsyncAccountResourceWithRawResponse(client.account)
430430
self.models = models.AsyncModelsResourceWithRawResponse(client.models)
431431
self.predictions = predictions.AsyncPredictionsResourceWithRawResponse(client.predictions)
432432
self.trainings = trainings.AsyncTrainingsResourceWithRawResponse(client.trainings)
@@ -438,7 +438,7 @@ def __init__(self, client: ReplicateClient) -> None:
438438
self.collections = collections.CollectionsResourceWithStreamingResponse(client.collections)
439439
self.deployments = deployments.DeploymentsResourceWithStreamingResponse(client.deployments)
440440
self.hardware = hardware.HardwareResourceWithStreamingResponse(client.hardware)
441-
self.accounts = accounts.AccountsResourceWithStreamingResponse(client.accounts)
441+
self.account = account.AccountResourceWithStreamingResponse(client.account)
442442
self.models = models.ModelsResourceWithStreamingResponse(client.models)
443443
self.predictions = predictions.PredictionsResourceWithStreamingResponse(client.predictions)
444444
self.trainings = trainings.TrainingsResourceWithStreamingResponse(client.trainings)
@@ -450,7 +450,7 @@ def __init__(self, client: AsyncReplicateClient) -> None:
450450
self.collections = collections.AsyncCollectionsResourceWithStreamingResponse(client.collections)
451451
self.deployments = deployments.AsyncDeploymentsResourceWithStreamingResponse(client.deployments)
452452
self.hardware = hardware.AsyncHardwareResourceWithStreamingResponse(client.hardware)
453-
self.accounts = accounts.AsyncAccountsResourceWithStreamingResponse(client.accounts)
453+
self.account = account.AsyncAccountResourceWithStreamingResponse(client.account)
454454
self.models = models.AsyncModelsResourceWithStreamingResponse(client.models)
455455
self.predictions = predictions.AsyncPredictionsResourceWithStreamingResponse(client.predictions)
456456
self.trainings = trainings.AsyncTrainingsResourceWithStreamingResponse(client.trainings)

src/replicate/_module_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ def __load__(self) -> resources.ModelsResource:
1212
return _load_client().models
1313

1414

15-
class HardwareResourceProxy(LazyProxy[resources.HardwareResource]):
15+
class AccountResourceProxy(LazyProxy[resources.AccountResource]):
1616
@override
17-
def __load__(self) -> resources.HardwareResource:
18-
return _load_client().hardware
17+
def __load__(self) -> resources.AccountResource:
18+
return _load_client().account
1919

2020

21-
class AccountsResourceProxy(LazyProxy[resources.AccountsResource]):
21+
class HardwareResourceProxy(LazyProxy[resources.HardwareResource]):
2222
@override
23-
def __load__(self) -> resources.AccountsResource:
24-
return _load_client().accounts
23+
def __load__(self) -> resources.HardwareResource:
24+
return _load_client().hardware
2525

2626

2727
class WebhooksResourceProxy(LazyProxy[resources.WebhooksResource]):
@@ -55,8 +55,8 @@ def __load__(self) -> resources.PredictionsResource:
5555

5656

5757
models: resources.ModelsResource = ModelsResourceProxy().__as_proxied__()
58+
account: resources.AccountResource = AccountResourceProxy().__as_proxied__()
5859
hardware: resources.HardwareResource = HardwareResourceProxy().__as_proxied__()
59-
accounts: resources.AccountsResource = AccountsResourceProxy().__as_proxied__()
6060
webhooks: resources.WebhooksResource = WebhooksResourceProxy().__as_proxied__()
6161
trainings: resources.TrainingsResource = TrainingsResourceProxy().__as_proxied__()
6262
collections: resources.CollectionsResource = CollectionsResourceProxy().__as_proxied__()

0 commit comments

Comments
 (0)