-
Notifications
You must be signed in to change notification settings - Fork 0
release: 0.1.0-alpha.4 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stainless-app
merged 2 commits into
main
from
release-please--branches--main--changes--next
Apr 23, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| ".": "0.1.0-alpha.3" | ||
| ".": "0.1.0-alpha.4" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| configured_endpoints: 27 | ||
| 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: d1d273c0d97d034d24c7eac8ef51d2ac | ||
| config_hash: 976e20887b4e455f639ee6917de350b8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.3" # x-release-please-version | ||
| __version__ = "0.1.0-alpha.4" # x-release-please-version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,230 @@ | ||
| # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import httpx | ||
|
|
||
| from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven | ||
| from ..._compat import cached_property | ||
| from ..._resource import SyncAPIResource, AsyncAPIResource | ||
| from ..._response import ( | ||
| to_raw_response_wrapper, | ||
| to_streamed_response_wrapper, | ||
| async_to_raw_response_wrapper, | ||
| async_to_streamed_response_wrapper, | ||
| ) | ||
| from ..._base_client import make_request_options | ||
|
|
||
| __all__ = ["ExamplesResource", "AsyncExamplesResource"] | ||
|
|
||
|
|
||
| class ExamplesResource(SyncAPIResource): | ||
| @cached_property | ||
| def with_raw_response(self) -> ExamplesResourceWithRawResponse: | ||
| """ | ||
| This property can be used as a prefix for any HTTP method call to return | ||
| the raw response object instead of the parsed content. | ||
|
|
||
| For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers | ||
| """ | ||
| return ExamplesResourceWithRawResponse(self) | ||
|
|
||
| @cached_property | ||
| def with_streaming_response(self) -> ExamplesResourceWithStreamingResponse: | ||
| """ | ||
| An alternative to `.with_raw_response` that doesn't eagerly read the response body. | ||
|
|
||
| For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response | ||
| """ | ||
| return ExamplesResourceWithStreamingResponse(self) | ||
|
|
||
| def list( | ||
| self, | ||
| model_name: str, | ||
| *, | ||
| model_owner: 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: | ||
| """ | ||
| List | ||
| [example predictions](https://replicate.com/docs/topics/models/publish-a-model#what-are-examples) | ||
| made using the model. These are predictions that were saved by the model author | ||
| as illustrative examples of the model's capabilities. | ||
|
|
||
| If you want all the examples for a model, use this operation. | ||
|
|
||
| If you just want the model's default example, you can use the | ||
| [`models.get`](#models.get) operation instead, which includes a | ||
| `default_example` object. | ||
|
|
||
| Example cURL request: | ||
|
|
||
| ```console | ||
| curl -s \\ | ||
| -H "Authorization: Bearer $REPLICATE_API_TOKEN" \\ | ||
| https://api.replicate.com/v1/models/replicate/hello-world/examples | ||
| ``` | ||
|
|
||
| The response will be a pagination object containing a list of example | ||
| predictions: | ||
|
|
||
| ```json | ||
| { | ||
| "next": "https://api.replicate.com/v1/models/replicate/hello-world/examples?cursor=...", | ||
| "previous": "https://api.replicate.com/v1/models/replicate/hello-world/examples?cursor=...", | ||
| "results": [...] | ||
| } | ||
| ``` | ||
|
|
||
| Each item in the `results` list is a [prediction object](#predictions.get). | ||
|
|
||
| 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 model_owner: | ||
| raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}") | ||
| if not model_name: | ||
| raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}") | ||
| extra_headers = {"Accept": "*/*", **(extra_headers or {})} | ||
| return self._get( | ||
| f"/models/{model_owner}/{model_name}/examples", | ||
| options=make_request_options( | ||
| extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout | ||
| ), | ||
| cast_to=NoneType, | ||
| ) | ||
|
|
||
|
|
||
| class AsyncExamplesResource(AsyncAPIResource): | ||
| @cached_property | ||
| def with_raw_response(self) -> AsyncExamplesResourceWithRawResponse: | ||
| """ | ||
| This property can be used as a prefix for any HTTP method call to return | ||
| the raw response object instead of the parsed content. | ||
|
|
||
| For more information, see https://www.github.com/replicate/replicate-python-stainless#accessing-raw-response-data-eg-headers | ||
| """ | ||
| return AsyncExamplesResourceWithRawResponse(self) | ||
|
|
||
| @cached_property | ||
| def with_streaming_response(self) -> AsyncExamplesResourceWithStreamingResponse: | ||
| """ | ||
| An alternative to `.with_raw_response` that doesn't eagerly read the response body. | ||
|
|
||
| For more information, see https://www.github.com/replicate/replicate-python-stainless#with_streaming_response | ||
| """ | ||
| return AsyncExamplesResourceWithStreamingResponse(self) | ||
|
|
||
| async def list( | ||
| self, | ||
| model_name: str, | ||
| *, | ||
| model_owner: 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: | ||
| """ | ||
| List | ||
| [example predictions](https://replicate.com/docs/topics/models/publish-a-model#what-are-examples) | ||
| made using the model. These are predictions that were saved by the model author | ||
| as illustrative examples of the model's capabilities. | ||
|
|
||
| If you want all the examples for a model, use this operation. | ||
|
|
||
| If you just want the model's default example, you can use the | ||
| [`models.get`](#models.get) operation instead, which includes a | ||
| `default_example` object. | ||
|
|
||
| Example cURL request: | ||
|
|
||
| ```console | ||
| curl -s \\ | ||
| -H "Authorization: Bearer $REPLICATE_API_TOKEN" \\ | ||
| https://api.replicate.com/v1/models/replicate/hello-world/examples | ||
| ``` | ||
|
|
||
| The response will be a pagination object containing a list of example | ||
| predictions: | ||
|
|
||
| ```json | ||
| { | ||
| "next": "https://api.replicate.com/v1/models/replicate/hello-world/examples?cursor=...", | ||
| "previous": "https://api.replicate.com/v1/models/replicate/hello-world/examples?cursor=...", | ||
| "results": [...] | ||
| } | ||
| ``` | ||
|
|
||
| Each item in the `results` list is a [prediction object](#predictions.get). | ||
|
|
||
| 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 model_owner: | ||
| raise ValueError(f"Expected a non-empty value for `model_owner` but received {model_owner!r}") | ||
| if not model_name: | ||
| raise ValueError(f"Expected a non-empty value for `model_name` but received {model_name!r}") | ||
| extra_headers = {"Accept": "*/*", **(extra_headers or {})} | ||
| return await self._get( | ||
| f"/models/{model_owner}/{model_name}/examples", | ||
| options=make_request_options( | ||
| extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout | ||
| ), | ||
| cast_to=NoneType, | ||
| ) | ||
|
|
||
|
|
||
| class ExamplesResourceWithRawResponse: | ||
| def __init__(self, examples: ExamplesResource) -> None: | ||
| self._examples = examples | ||
|
|
||
| self.list = to_raw_response_wrapper( | ||
| examples.list, | ||
| ) | ||
|
|
||
|
|
||
| class AsyncExamplesResourceWithRawResponse: | ||
| def __init__(self, examples: AsyncExamplesResource) -> None: | ||
| self._examples = examples | ||
|
|
||
| self.list = async_to_raw_response_wrapper( | ||
| examples.list, | ||
| ) | ||
|
|
||
|
|
||
| class ExamplesResourceWithStreamingResponse: | ||
| def __init__(self, examples: ExamplesResource) -> None: | ||
| self._examples = examples | ||
|
|
||
| self.list = to_streamed_response_wrapper( | ||
| examples.list, | ||
| ) | ||
|
|
||
|
|
||
| class AsyncExamplesResourceWithStreamingResponse: | ||
| def __init__(self, examples: AsyncExamplesResource) -> None: | ||
| self._examples = examples | ||
|
|
||
| self.list = async_to_streamed_response_wrapper( | ||
| examples.list, | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.