Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.4"
".": "0.1.0-alpha.5"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-2788217b7ad7d61d1a77800bc5ff12a6810f1692d4d770b72fa8f898c6a055ab.yml
openapi_spec_hash: 4423bf747e228484547b441468a9f156
config_hash: 976e20887b4e455f639ee6917de350b8
config_hash: d820945093fc56fea6d062c90745d7a5
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.0-alpha.5 (2025-04-24)

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)

### Features

* add missing resources ([8bbddc7](https://github.com/replicate/replicate-python-stainless/commit/8bbddc7a788f4488311b8ed408d4b020db8e006b))
* enable `openapi.code_samples` ([85810f5](https://github.com/replicate/replicate-python-stainless/commit/85810f5f4c0caf680a90fca80f1bfcd639e76894))

## 0.1.0-alpha.4 (2025-04-23)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/replicate/replicate-python-stainless/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
Expand Down
31 changes: 18 additions & 13 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Methods:

- <code title="get /collections">client.collections.<a href="./src/replicate/resources/collections.py">list</a>() -> None</code>
- <code title="get /collections/{collection_slug}">client.collections.<a href="./src/replicate/resources/collections.py">get</a>(collection_slug) -> None</code>

# Deployments

Expand All @@ -24,7 +25,6 @@ Methods:
- <code title="get /deployments">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">list</a>() -> <a href="./src/replicate/types/deployment_list_response.py">SyncCursorURLPage[DeploymentListResponse]</a></code>
- <code title="delete /deployments/{deployment_owner}/{deployment_name}">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">delete</a>(deployment_name, \*, deployment_owner) -> None</code>
- <code title="get /deployments/{deployment_owner}/{deployment_name}">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">get</a>(deployment_name, \*, deployment_owner) -> <a href="./src/replicate/types/deployment_get_response.py">DeploymentGetResponse</a></code>
- <code title="get /collections">client.deployments.<a href="./src/replicate/resources/deployments/deployments.py">list_em_all</a>() -> None</code>

## Predictions

Expand All @@ -43,7 +43,6 @@ from replicate.types import HardwareListResponse
Methods:

- <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>
- <code title="get /collections/{collection_slug}">client.hardware.<a href="./src/replicate/resources/hardware.py">retrieve_collections</a>(collection_slug) -> None</code>

# Accounts

Expand All @@ -70,7 +69,6 @@ Methods:
- <code title="post /models">client.models.<a href="./src/replicate/resources/models/models.py">create</a>(\*\*<a href="src/replicate/types/model_create_params.py">params</a>) -> None</code>
- <code title="get /models">client.models.<a href="./src/replicate/resources/models/models.py">list</a>() -> <a href="./src/replicate/types/model_list_response.py">SyncCursorURLPage[ModelListResponse]</a></code>
- <code title="delete /models/{model_owner}/{model_name}">client.models.<a href="./src/replicate/resources/models/models.py">delete</a>(model_name, \*, model_owner) -> None</code>
- <code title="post /models/{model_owner}/{model_name}/predictions">client.models.<a href="./src/replicate/resources/models/models.py">create_prediction</a>(model_name, \*, model_owner, \*\*<a href="src/replicate/types/model_create_prediction_params.py">params</a>) -> <a href="./src/replicate/types/prediction.py">Prediction</a></code>
- <code title="get /models/{model_owner}/{model_name}">client.models.<a href="./src/replicate/resources/models/models.py">get</a>(model_name, \*, model_owner) -> None</code>

## Examples
Expand All @@ -79,6 +77,12 @@ Methods:

- <code title="get /models/{model_owner}/{model_name}/examples">client.models.examples.<a href="./src/replicate/resources/models/examples.py">list</a>(model_name, \*, model_owner) -> None</code>

## Predictions

Methods:

- <code title="post /models/{model_owner}/{model_name}/predictions">client.models.predictions.<a href="./src/replicate/resources/models/predictions.py">create</a>(model_name, \*, model_owner, \*\*<a href="src/replicate/types/models/prediction_create_params.py">params</a>) -> <a href="./src/replicate/types/prediction.py">Prediction</a></code>

## Readme

Types:
Expand All @@ -93,17 +97,10 @@ Methods:

## Versions

Types:

```python
from replicate.types.models import VersionCreateTrainingResponse
```

Methods:

- <code title="get /models/{model_owner}/{model_name}/versions">client.models.versions.<a href="./src/replicate/resources/models/versions.py">list</a>(model_name, \*, model_owner) -> None</code>
- <code title="delete /models/{model_owner}/{model_name}/versions/{version_id}">client.models.versions.<a href="./src/replicate/resources/models/versions.py">delete</a>(version_id, \*, model_owner, model_name) -> None</code>
- <code title="post /models/{model_owner}/{model_name}/versions/{version_id}/trainings">client.models.versions.<a href="./src/replicate/resources/models/versions.py">create_training</a>(version_id, \*, model_owner, model_name, \*\*<a href="src/replicate/types/models/version_create_training_params.py">params</a>) -> <a href="./src/replicate/types/models/version_create_training_response.py">VersionCreateTrainingResponse</a></code>
- <code title="get /models/{model_owner}/{model_name}/versions/{version_id}">client.models.versions.<a href="./src/replicate/resources/models/versions.py">get</a>(version_id, \*, model_owner, model_name) -> None</code>

# Predictions
Expand All @@ -126,11 +123,17 @@ Methods:
Types:

```python
from replicate.types import TrainingListResponse, TrainingCancelResponse, TrainingGetResponse
from replicate.types import (
TrainingCreateResponse,
TrainingListResponse,
TrainingCancelResponse,
TrainingGetResponse,
)
```

Methods:

- <code title="post /models/{model_owner}/{model_name}/versions/{version_id}/trainings">client.trainings.<a href="./src/replicate/resources/trainings.py">create</a>(version_id, \*, model_owner, model_name, \*\*<a href="src/replicate/types/training_create_params.py">params</a>) -> <a href="./src/replicate/types/training_create_response.py">TrainingCreateResponse</a></code>
- <code title="get /trainings">client.trainings.<a href="./src/replicate/resources/trainings.py">list</a>() -> <a href="./src/replicate/types/training_list_response.py">SyncCursorURLPage[TrainingListResponse]</a></code>
- <code title="post /trainings/{training_id}/cancel">client.trainings.<a href="./src/replicate/resources/trainings.py">cancel</a>(training_id) -> <a href="./src/replicate/types/training_cancel_response.py">TrainingCancelResponse</a></code>
- <code title="get /trainings/{training_id}">client.trainings.<a href="./src/replicate/resources/trainings.py">get</a>(training_id) -> <a href="./src/replicate/types/training_get_response.py">TrainingGetResponse</a></code>
Expand All @@ -139,12 +142,14 @@ Methods:

## Default

### Secret

Types:

```python
from replicate.types.webhooks import DefaultRetrieveSecretResponse
from replicate.types.webhooks.default import SecretGetResponse
```

Methods:

- <code title="get /webhooks/default/secret">client.webhooks.default.<a href="./src/replicate/resources/webhooks/default.py">retrieve_secret</a>() -> <a href="./src/replicate/types/webhooks/default_retrieve_secret_response.py">DefaultRetrieveSecretResponse</a></code>
- <code title="get /webhooks/default/secret">client.webhooks.default.secret.<a href="./src/replicate/resources/webhooks/default/secret.py">get</a>() -> <a href="./src/replicate/types/webhooks/default/secret_get_response.py">SecretGetResponse</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "replicate-stainless"
version = "0.1.0-alpha.4"
version = "0.1.0-alpha.5"
description = "The official Python library for the replicate-client API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/replicate/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "replicate"
__version__ = "0.1.0-alpha.4" # x-release-please-version
__version__ = "0.1.0-alpha.5" # x-release-please-version
116 changes: 116 additions & 0 deletions src/replicate/resources/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,58 @@ def list(
cast_to=NoneType,
)

def get(
self,
collection_slug: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> None:
"""
Example cURL request:

```console
curl -s \\
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
https://api.replicate.com/v1/collections/super-resolution
```

The response will be a collection object with a nested list of the models in
that collection:

```json
{
"name": "Super resolution",
"slug": "super-resolution",
"description": "Upscaling models that create high-quality images from low-quality images.",
"models": [...]
}
```

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not collection_slug:
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._get(
f"/collections/{collection_slug}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)


class AsyncCollectionsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -147,6 +199,58 @@ async def list(
cast_to=NoneType,
)

async def get(
self,
collection_slug: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> None:
"""
Example cURL request:

```console
curl -s \\
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \\
https://api.replicate.com/v1/collections/super-resolution
```

The response will be a collection object with a nested list of the models in
that collection:

```json
{
"name": "Super resolution",
"slug": "super-resolution",
"description": "Upscaling models that create high-quality images from low-quality images.",
"models": [...]
}
```

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not collection_slug:
raise ValueError(f"Expected a non-empty value for `collection_slug` but received {collection_slug!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._get(
f"/collections/{collection_slug}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)


class CollectionsResourceWithRawResponse:
def __init__(self, collections: CollectionsResource) -> None:
Expand All @@ -155,6 +259,9 @@ def __init__(self, collections: CollectionsResource) -> None:
self.list = to_raw_response_wrapper(
collections.list,
)
self.get = to_raw_response_wrapper(
collections.get,
)


class AsyncCollectionsResourceWithRawResponse:
Expand All @@ -164,6 +271,9 @@ def __init__(self, collections: AsyncCollectionsResource) -> None:
self.list = async_to_raw_response_wrapper(
collections.list,
)
self.get = async_to_raw_response_wrapper(
collections.get,
)


class CollectionsResourceWithStreamingResponse:
Expand All @@ -173,6 +283,9 @@ def __init__(self, collections: CollectionsResource) -> None:
self.list = to_streamed_response_wrapper(
collections.list,
)
self.get = to_streamed_response_wrapper(
collections.get,
)


class AsyncCollectionsResourceWithStreamingResponse:
Expand All @@ -182,3 +295,6 @@ def __init__(self, collections: AsyncCollectionsResource) -> None:
self.list = async_to_streamed_response_wrapper(
collections.list,
)
self.get = async_to_streamed_response_wrapper(
collections.get,
)
Loading