Skip to content

Commit e501778

Browse files
fix: correct mapping for account.get
1 parent 5656ef3 commit e501778

File tree

12 files changed

+112
-112
lines changed

12 files changed

+112
-112
lines changed

.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

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

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__()

src/replicate/resources/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
ModelsResourceWithStreamingResponse,
99
AsyncModelsResourceWithStreamingResponse,
1010
)
11-
from .accounts import (
12-
AccountsResource,
13-
AsyncAccountsResource,
14-
AccountsResourceWithRawResponse,
15-
AsyncAccountsResourceWithRawResponse,
16-
AccountsResourceWithStreamingResponse,
17-
AsyncAccountsResourceWithStreamingResponse,
11+
from .account import (
12+
AccountResource,
13+
AsyncAccountResource,
14+
AccountResourceWithRawResponse,
15+
AsyncAccountResourceWithRawResponse,
16+
AccountResourceWithStreamingResponse,
17+
AsyncAccountResourceWithStreamingResponse,
1818
)
1919
from .hardware import (
2020
HardwareResource,
@@ -84,12 +84,12 @@
8484
"AsyncHardwareResourceWithRawResponse",
8585
"HardwareResourceWithStreamingResponse",
8686
"AsyncHardwareResourceWithStreamingResponse",
87-
"AccountsResource",
88-
"AsyncAccountsResource",
89-
"AccountsResourceWithRawResponse",
90-
"AsyncAccountsResourceWithRawResponse",
91-
"AccountsResourceWithStreamingResponse",
92-
"AsyncAccountsResourceWithStreamingResponse",
87+
"AccountResource",
88+
"AsyncAccountResource",
89+
"AccountResourceWithRawResponse",
90+
"AsyncAccountResourceWithRawResponse",
91+
"AccountResourceWithStreamingResponse",
92+
"AsyncAccountResourceWithStreamingResponse",
9393
"ModelsResource",
9494
"AsyncModelsResource",
9595
"ModelsResourceWithRawResponse",

0 commit comments

Comments
 (0)