diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 46b9b6b..3b005e5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.9" + ".": "0.1.0-alpha.10" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 66ca18c..3ffb33a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-0d7d82bff8a18b03e0cd1cbf8609c3026bb07db851bc6f9166032045a9925eea.yml openapi_spec_hash: 8ce211dfa6fece24b1413e91ba55210a -config_hash: c784c102324b1d027c6ce40e17fe9590 +config_hash: 927b6ebc00ee115763ad69483bbf5566 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bd87fe..0f6b193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.10 (2025-05-06) + +Full Changelog: [v0.1.0-alpha.9...v0.1.0-alpha.10](https://github.com/replicate/replicate-python-stainless/compare/v0.1.0-alpha.9...v0.1.0-alpha.10) + +### Bug Fixes + +* disable settings.positional_params ([f018f4b](https://github.com/replicate/replicate-python-stainless/commit/f018f4b81e50ae538d9430aa1cdde7f64100031a)) + ## 0.1.0-alpha.9 (2025-05-06) Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/replicate/replicate-python-stainless/compare/v0.1.0-alpha.8...v0.1.0-alpha.9) diff --git a/api.md b/api.md index 2f6581a..0afde25 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,7 @@ Methods: - client.collections.list() -> None -- client.collections.get(collection_slug) -> None +- client.collections.get(\*, collection_slug) -> None # Deployments @@ -21,16 +21,16 @@ from replicate.types import ( Methods: - client.deployments.create(\*\*params) -> DeploymentCreateResponse -- client.deployments.update(deployment_name, \*, deployment_owner, \*\*params) -> DeploymentUpdateResponse +- client.deployments.update(\*, deployment_owner, deployment_name, \*\*params) -> DeploymentUpdateResponse - client.deployments.list() -> SyncCursorURLPage[DeploymentListResponse] -- client.deployments.delete(deployment_name, \*, deployment_owner) -> None -- client.deployments.get(deployment_name, \*, deployment_owner) -> DeploymentGetResponse +- client.deployments.delete(\*, deployment_owner, deployment_name) -> None +- client.deployments.get(\*, deployment_owner, deployment_name) -> DeploymentGetResponse ## Predictions Methods: -- client.deployments.predictions.create(deployment_name, \*, deployment_owner, \*\*params) -> Prediction +- client.deployments.predictions.create(\*, deployment_owner, deployment_name, \*\*params) -> Prediction # Hardware @@ -68,21 +68,21 @@ Methods: - client.models.create(\*\*params) -> None - client.models.list() -> SyncCursorURLPage[ModelListResponse] -- client.models.delete(model_name, \*, model_owner) -> None -- client.models.get(model_name, \*, model_owner) -> None +- client.models.delete(\*, model_owner, model_name) -> None +- client.models.get(\*, model_owner, model_name) -> None - client.models.search(\*\*params) -> None ## Examples Methods: -- client.models.examples.list(model_name, \*, model_owner) -> None +- client.models.examples.list(\*, model_owner, model_name) -> None ## Predictions Methods: -- client.models.predictions.create(model_name, \*, model_owner, \*\*params) -> Prediction +- client.models.predictions.create(\*, model_owner, model_name, \*\*params) -> Prediction ## Readme @@ -94,15 +94,15 @@ from replicate.types.models import ReadmeGetResponse Methods: -- client.models.readme.get(model_name, \*, model_owner) -> str +- client.models.readme.get(\*, model_owner, model_name) -> str ## Versions Methods: -- client.models.versions.list(model_name, \*, model_owner) -> None -- client.models.versions.delete(version_id, \*, model_owner, model_name) -> None -- client.models.versions.get(version_id, \*, model_owner, model_name) -> None +- client.models.versions.list(\*, model_owner, model_name) -> None +- client.models.versions.delete(\*, model_owner, model_name, version_id) -> None +- client.models.versions.get(\*, model_owner, model_name, version_id) -> None # Predictions @@ -116,8 +116,8 @@ Methods: - client.predictions.create(\*\*params) -> Prediction - client.predictions.list(\*\*params) -> SyncCursorURLPageWithCreatedFilters[Prediction] -- client.predictions.cancel(prediction_id) -> None -- client.predictions.get(prediction_id) -> Prediction +- client.predictions.cancel(\*, prediction_id) -> None +- client.predictions.get(\*, prediction_id) -> Prediction # Trainings @@ -134,10 +134,10 @@ from replicate.types import ( Methods: -- client.trainings.create(version_id, \*, model_owner, model_name, \*\*params) -> TrainingCreateResponse +- client.trainings.create(\*, model_owner, model_name, version_id, \*\*params) -> TrainingCreateResponse - client.trainings.list() -> SyncCursorURLPage[TrainingListResponse] -- client.trainings.cancel(training_id) -> TrainingCancelResponse -- client.trainings.get(training_id) -> TrainingGetResponse +- client.trainings.cancel(\*, training_id) -> TrainingCancelResponse +- client.trainings.get(\*, training_id) -> TrainingGetResponse # Webhooks diff --git a/pyproject.toml b/pyproject.toml index b282b63..cfe6666 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "replicate-stainless" -version = "0.1.0-alpha.9" +version = "0.1.0-alpha.10" description = "The official Python library for the replicate API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/replicate/_version.py b/src/replicate/_version.py index 5cd526a..7033e86 100644 --- a/src/replicate/_version.py +++ b/src/replicate/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "replicate" -__version__ = "0.1.0-alpha.9" # x-release-please-version +__version__ = "0.1.0-alpha.10" # x-release-please-version diff --git a/src/replicate/resources/collections.py b/src/replicate/resources/collections.py index adf0d9a..57aeffd 100644 --- a/src/replicate/resources/collections.py +++ b/src/replicate/resources/collections.py @@ -84,8 +84,8 @@ def list( def get( self, - collection_slug: str, *, + 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, @@ -201,8 +201,8 @@ async def list( async def get( self, - collection_slug: str, *, + 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, diff --git a/src/replicate/resources/deployments/deployments.py b/src/replicate/resources/deployments/deployments.py index 4ac53ff..613d0e9 100644 --- a/src/replicate/resources/deployments/deployments.py +++ b/src/replicate/resources/deployments/deployments.py @@ -164,9 +164,9 @@ def create( def update( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: str, hardware: str | NotGiven = NOT_GIVEN, max_instances: int | NotGiven = NOT_GIVEN, min_instances: int | NotGiven = NOT_GIVEN, @@ -330,9 +330,9 @@ def list( def delete( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: 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, @@ -382,9 +382,9 @@ def delete( def get( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: 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, @@ -583,9 +583,9 @@ async def create( async def update( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: str, hardware: str | NotGiven = NOT_GIVEN, max_instances: int | NotGiven = NOT_GIVEN, min_instances: int | NotGiven = NOT_GIVEN, @@ -749,9 +749,9 @@ def list( async def delete( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: 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, @@ -801,9 +801,9 @@ async def delete( async def get( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: 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, diff --git a/src/replicate/resources/deployments/predictions.py b/src/replicate/resources/deployments/predictions.py index c94fff0..0f2914a 100644 --- a/src/replicate/resources/deployments/predictions.py +++ b/src/replicate/resources/deployments/predictions.py @@ -46,9 +46,9 @@ def with_streaming_response(self) -> PredictionsResourceWithStreamingResponse: def create( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: str, input: object, stream: bool | NotGiven = NOT_GIVEN, webhook: str | NotGiven = NOT_GIVEN, @@ -203,9 +203,9 @@ def with_streaming_response(self) -> AsyncPredictionsResourceWithStreamingRespon async def create( self, - deployment_name: str, *, deployment_owner: str, + deployment_name: str, input: object, stream: bool | NotGiven = NOT_GIVEN, webhook: str | NotGiven = NOT_GIVEN, diff --git a/src/replicate/resources/models/examples.py b/src/replicate/resources/models/examples.py index dfb4df5..a989051 100644 --- a/src/replicate/resources/models/examples.py +++ b/src/replicate/resources/models/examples.py @@ -40,9 +40,9 @@ def with_streaming_response(self) -> ExamplesResourceWithStreamingResponse: def list( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -128,9 +128,9 @@ def with_streaming_response(self) -> AsyncExamplesResourceWithStreamingResponse: async def list( self, - model_name: str, *, model_owner: str, + model_name: 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, diff --git a/src/replicate/resources/models/models.py b/src/replicate/resources/models/models.py index fbc48e3..eed71b1 100644 --- a/src/replicate/resources/models/models.py +++ b/src/replicate/resources/models/models.py @@ -241,9 +241,9 @@ def list( def delete( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -297,9 +297,9 @@ def delete( def get( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -641,9 +641,9 @@ def list( async def delete( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -697,9 +697,9 @@ async def delete( async def get( self, - model_name: str, *, model_owner: str, + model_name: 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, diff --git a/src/replicate/resources/models/predictions.py b/src/replicate/resources/models/predictions.py index 03d8e5b..f0120bc 100644 --- a/src/replicate/resources/models/predictions.py +++ b/src/replicate/resources/models/predictions.py @@ -46,9 +46,9 @@ def with_streaming_response(self) -> PredictionsResourceWithStreamingResponse: def create( self, - model_name: str, *, model_owner: str, + model_name: str, input: object, stream: bool | NotGiven = NOT_GIVEN, webhook: str | NotGiven = NOT_GIVEN, @@ -207,9 +207,9 @@ def with_streaming_response(self) -> AsyncPredictionsResourceWithStreamingRespon async def create( self, - model_name: str, *, model_owner: str, + model_name: str, input: object, stream: bool | NotGiven = NOT_GIVEN, webhook: str | NotGiven = NOT_GIVEN, diff --git a/src/replicate/resources/models/readme.py b/src/replicate/resources/models/readme.py index 39c006e..53d9f28 100644 --- a/src/replicate/resources/models/readme.py +++ b/src/replicate/resources/models/readme.py @@ -40,9 +40,9 @@ def with_streaming_response(self) -> ReadmeResourceWithStreamingResponse: def get( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -114,9 +114,9 @@ def with_streaming_response(self) -> AsyncReadmeResourceWithStreamingResponse: async def get( self, - model_name: str, *, model_owner: str, + model_name: 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, diff --git a/src/replicate/resources/models/versions.py b/src/replicate/resources/models/versions.py index 294664e..ac24b39 100644 --- a/src/replicate/resources/models/versions.py +++ b/src/replicate/resources/models/versions.py @@ -40,9 +40,9 @@ def with_streaming_response(self) -> VersionsResourceWithStreamingResponse: def list( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -101,10 +101,10 @@ def list( def delete( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: 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, @@ -164,10 +164,10 @@ def delete( def get( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: 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, @@ -280,9 +280,9 @@ def with_streaming_response(self) -> AsyncVersionsResourceWithStreamingResponse: async def list( self, - model_name: str, *, model_owner: str, + model_name: 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, @@ -341,10 +341,10 @@ async def list( async def delete( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: 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, @@ -404,10 +404,10 @@ async def delete( async def get( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: 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, diff --git a/src/replicate/resources/predictions.py b/src/replicate/resources/predictions.py index 6388e08..1ced764 100644 --- a/src/replicate/resources/predictions.py +++ b/src/replicate/resources/predictions.py @@ -309,8 +309,8 @@ def list( def cancel( self, - prediction_id: str, *, + prediction_id: 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, @@ -343,8 +343,8 @@ def cancel( def get( self, - prediction_id: str, *, + prediction_id: 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, @@ -727,8 +727,8 @@ def list( async def cancel( self, - prediction_id: str, *, + prediction_id: 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, @@ -761,8 +761,8 @@ async def cancel( async def get( self, - prediction_id: str, *, + prediction_id: 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, diff --git a/src/replicate/resources/trainings.py b/src/replicate/resources/trainings.py index 4b9d127..7e18dc1 100644 --- a/src/replicate/resources/trainings.py +++ b/src/replicate/resources/trainings.py @@ -50,10 +50,10 @@ def with_streaming_response(self) -> TrainingsResourceWithStreamingResponse: def create( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: str, destination: str, input: object, webhook: str | NotGiven = NOT_GIVEN, @@ -284,8 +284,8 @@ def list( def cancel( self, - training_id: str, *, + training_id: 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, @@ -317,8 +317,8 @@ def cancel( def get( self, - training_id: str, *, + training_id: 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, @@ -431,10 +431,10 @@ def with_streaming_response(self) -> AsyncTrainingsResourceWithStreamingResponse async def create( self, - version_id: str, *, model_owner: str, model_name: str, + version_id: str, destination: str, input: object, webhook: str | NotGiven = NOT_GIVEN, @@ -665,8 +665,8 @@ def list( async def cancel( self, - training_id: str, *, + training_id: 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, @@ -698,8 +698,8 @@ async def cancel( async def get( self, - training_id: str, *, + training_id: 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, diff --git a/src/replicate/types/deployment_update_params.py b/src/replicate/types/deployment_update_params.py index 7c682f4..ee546b4 100644 --- a/src/replicate/types/deployment_update_params.py +++ b/src/replicate/types/deployment_update_params.py @@ -10,6 +10,8 @@ class DeploymentUpdateParams(TypedDict, total=False): deployment_owner: Required[str] + deployment_name: Required[str] + hardware: str """The SKU for the hardware used to run the model. diff --git a/src/replicate/types/deployments/prediction_create_params.py b/src/replicate/types/deployments/prediction_create_params.py index 81c276d..ed99336 100644 --- a/src/replicate/types/deployments/prediction_create_params.py +++ b/src/replicate/types/deployments/prediction_create_params.py @@ -13,6 +13,8 @@ class PredictionCreateParams(TypedDict, total=False): deployment_owner: Required[str] + deployment_name: Required[str] + input: Required[object] """The model's input as a JSON object. diff --git a/src/replicate/types/models/prediction_create_params.py b/src/replicate/types/models/prediction_create_params.py index 6b76121..0427671 100644 --- a/src/replicate/types/models/prediction_create_params.py +++ b/src/replicate/types/models/prediction_create_params.py @@ -13,6 +13,8 @@ class PredictionCreateParams(TypedDict, total=False): model_owner: Required[str] + model_name: Required[str] + input: Required[object] """The model's input as a JSON object. diff --git a/src/replicate/types/training_create_params.py b/src/replicate/types/training_create_params.py index 38542fb..32b58ae 100644 --- a/src/replicate/types/training_create_params.py +++ b/src/replicate/types/training_create_params.py @@ -13,6 +13,8 @@ class TrainingCreateParams(TypedDict, total=False): model_name: Required[str] + version_id: Required[str] + destination: Required[str] """ A string representing the desired model to push to in the format diff --git a/tests/api_resources/deployments/test_predictions.py b/tests/api_resources/deployments/test_predictions.py index 33983d4..ab03f7e 100644 --- a/tests/api_resources/deployments/test_predictions.py +++ b/tests/api_resources/deployments/test_predictions.py @@ -21,8 +21,8 @@ class TestPredictions: @parametrize def test_method_create(self, client: Replicate) -> None: prediction = client.deployments.predictions.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -31,8 +31,8 @@ def test_method_create(self, client: Replicate) -> None: @parametrize def test_method_create_with_all_params(self, client: Replicate) -> None: prediction = client.deployments.predictions.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, stream=True, webhook="webhook", @@ -45,8 +45,8 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: @parametrize def test_raw_response_create(self, client: Replicate) -> None: response = client.deployments.predictions.with_raw_response.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) @@ -59,8 +59,8 @@ def test_raw_response_create(self, client: Replicate) -> None: @parametrize def test_streaming_response_create(self, client: Replicate) -> None: with client.deployments.predictions.with_streaming_response.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) as response: assert not response.is_closed @@ -76,15 +76,15 @@ def test_streaming_response_create(self, client: Replicate) -> None: def test_path_params_create(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): client.deployments.predictions.with_raw_response.create( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): client.deployments.predictions.with_raw_response.create( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", input={}, ) @@ -96,8 +96,8 @@ class TestAsyncPredictions: @parametrize async def test_method_create(self, async_client: AsyncReplicate) -> None: prediction = await async_client.deployments.predictions.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -106,8 +106,8 @@ async def test_method_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncReplicate) -> None: prediction = await async_client.deployments.predictions.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, stream=True, webhook="webhook", @@ -120,8 +120,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) @parametrize async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: response = await async_client.deployments.predictions.with_raw_response.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) @@ -134,8 +134,8 @@ async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncReplicate) -> None: async with async_client.deployments.predictions.with_streaming_response.create( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", input={}, ) as response: assert not response.is_closed @@ -151,14 +151,14 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) -> async def test_path_params_create(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): await async_client.deployments.predictions.with_raw_response.create( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): await async_client.deployments.predictions.with_raw_response.create( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", input={}, ) diff --git a/tests/api_resources/models/test_examples.py b/tests/api_resources/models/test_examples.py index 45a1f6a..3023f9c 100644 --- a/tests/api_resources/models/test_examples.py +++ b/tests/api_resources/models/test_examples.py @@ -19,8 +19,8 @@ class TestExamples: @parametrize def test_method_list(self, client: Replicate) -> None: example = client.models.examples.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert example is None @@ -28,8 +28,8 @@ def test_method_list(self, client: Replicate) -> None: @parametrize def test_raw_response_list(self, client: Replicate) -> None: response = client.models.examples.with_raw_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -41,8 +41,8 @@ def test_raw_response_list(self, client: Replicate) -> None: @parametrize def test_streaming_response_list(self, client: Replicate) -> None: with client.models.examples.with_streaming_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,14 +57,14 @@ def test_streaming_response_list(self, client: Replicate) -> None: def test_path_params_list(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.examples.with_raw_response.list( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.examples.with_raw_response.list( - model_name="", model_owner="model_owner", + model_name="", ) @@ -75,8 +75,8 @@ class TestAsyncExamples: @parametrize async def test_method_list(self, async_client: AsyncReplicate) -> None: example = await async_client.models.examples.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert example is None @@ -84,8 +84,8 @@ async def test_method_list(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncReplicate) -> None: response = await async_client.models.examples.with_raw_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -97,8 +97,8 @@ async def test_raw_response_list(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncReplicate) -> None: async with async_client.models.examples.with_streaming_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,12 +113,12 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No async def test_path_params_list(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.examples.with_raw_response.list( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.examples.with_raw_response.list( - model_name="", model_owner="model_owner", + model_name="", ) diff --git a/tests/api_resources/models/test_predictions.py b/tests/api_resources/models/test_predictions.py index 0bb48a6..0399b37 100644 --- a/tests/api_resources/models/test_predictions.py +++ b/tests/api_resources/models/test_predictions.py @@ -21,8 +21,8 @@ class TestPredictions: @parametrize def test_method_create(self, client: Replicate) -> None: prediction = client.models.predictions.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -31,8 +31,8 @@ def test_method_create(self, client: Replicate) -> None: @parametrize def test_method_create_with_all_params(self, client: Replicate) -> None: prediction = client.models.predictions.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, stream=True, webhook="webhook", @@ -45,8 +45,8 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: @parametrize def test_raw_response_create(self, client: Replicate) -> None: response = client.models.predictions.with_raw_response.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) @@ -59,8 +59,8 @@ def test_raw_response_create(self, client: Replicate) -> None: @parametrize def test_streaming_response_create(self, client: Replicate) -> None: with client.models.predictions.with_streaming_response.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) as response: assert not response.is_closed @@ -76,15 +76,15 @@ def test_streaming_response_create(self, client: Replicate) -> None: def test_path_params_create(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.predictions.with_raw_response.create( - model_name="model_name", model_owner="", + model_name="model_name", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.predictions.with_raw_response.create( - model_name="", model_owner="model_owner", + model_name="", input={}, ) @@ -96,8 +96,8 @@ class TestAsyncPredictions: @parametrize async def test_method_create(self, async_client: AsyncReplicate) -> None: prediction = await async_client.models.predictions.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -106,8 +106,8 @@ async def test_method_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncReplicate) -> None: prediction = await async_client.models.predictions.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, stream=True, webhook="webhook", @@ -120,8 +120,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) @parametrize async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: response = await async_client.models.predictions.with_raw_response.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) @@ -134,8 +134,8 @@ async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncReplicate) -> None: async with async_client.models.predictions.with_streaming_response.create( - model_name="model_name", model_owner="model_owner", + model_name="model_name", input={}, ) as response: assert not response.is_closed @@ -151,14 +151,14 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) -> async def test_path_params_create(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.predictions.with_raw_response.create( - model_name="model_name", model_owner="", + model_name="model_name", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.predictions.with_raw_response.create( - model_name="", model_owner="model_owner", + model_name="", input={}, ) diff --git a/tests/api_resources/models/test_readme.py b/tests/api_resources/models/test_readme.py index 698affd..3e34823 100644 --- a/tests/api_resources/models/test_readme.py +++ b/tests/api_resources/models/test_readme.py @@ -20,8 +20,8 @@ class TestReadme: @parametrize def test_method_get(self, client: Replicate) -> None: readme = client.models.readme.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert_matches_type(str, readme, path=["response"]) @@ -29,8 +29,8 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.models.readme.with_raw_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -42,8 +42,8 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.models.readme.with_streaming_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -58,14 +58,14 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.readme.with_raw_response.get( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.readme.with_raw_response.get( - model_name="", model_owner="model_owner", + model_name="", ) @@ -76,8 +76,8 @@ class TestAsyncReadme: @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: readme = await async_client.models.readme.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert_matches_type(str, readme, path=["response"]) @@ -85,8 +85,8 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.models.readme.with_raw_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -98,8 +98,8 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.models.readme.with_streaming_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -114,12 +114,12 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.readme.with_raw_response.get( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.readme.with_raw_response.get( - model_name="", model_owner="model_owner", + model_name="", ) diff --git a/tests/api_resources/models/test_versions.py b/tests/api_resources/models/test_versions.py index 6aac669..4236863 100644 --- a/tests/api_resources/models/test_versions.py +++ b/tests/api_resources/models/test_versions.py @@ -19,8 +19,8 @@ class TestVersions: @parametrize def test_method_list(self, client: Replicate) -> None: version = client.models.versions.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert version is None @@ -28,8 +28,8 @@ def test_method_list(self, client: Replicate) -> None: @parametrize def test_raw_response_list(self, client: Replicate) -> None: response = client.models.versions.with_raw_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -41,8 +41,8 @@ def test_raw_response_list(self, client: Replicate) -> None: @parametrize def test_streaming_response_list(self, client: Replicate) -> None: with client.models.versions.with_streaming_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -57,23 +57,23 @@ def test_streaming_response_list(self, client: Replicate) -> None: def test_path_params_list(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.versions.with_raw_response.list( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.versions.with_raw_response.list( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip() @parametrize def test_method_delete(self, client: Replicate) -> None: version = client.models.versions.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert version is None @@ -81,9 +81,9 @@ def test_method_delete(self, client: Replicate) -> None: @parametrize def test_raw_response_delete(self, client: Replicate) -> None: response = client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert response.is_closed is True @@ -95,9 +95,9 @@ def test_raw_response_delete(self, client: Replicate) -> None: @parametrize def test_streaming_response_delete(self, client: Replicate) -> None: with client.models.versions.with_streaming_response.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,32 +112,32 @@ def test_streaming_response_delete(self, client: Replicate) -> None: def test_path_params_delete(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): client.models.versions.with_raw_response.delete( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Replicate) -> None: version = client.models.versions.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert version is None @@ -145,9 +145,9 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert response.is_closed is True @@ -159,9 +159,9 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.models.versions.with_streaming_response.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -176,23 +176,23 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): client.models.versions.with_raw_response.get( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", ) @@ -203,8 +203,8 @@ class TestAsyncVersions: @parametrize async def test_method_list(self, async_client: AsyncReplicate) -> None: version = await async_client.models.versions.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert version is None @@ -212,8 +212,8 @@ async def test_method_list(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncReplicate) -> None: response = await async_client.models.versions.with_raw_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -225,8 +225,8 @@ async def test_raw_response_list(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncReplicate) -> None: async with async_client.models.versions.with_streaming_response.list( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,23 +241,23 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No async def test_path_params_list(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.versions.with_raw_response.list( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.versions.with_raw_response.list( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip() @parametrize async def test_method_delete(self, async_client: AsyncReplicate) -> None: version = await async_client.models.versions.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert version is None @@ -265,9 +265,9 @@ async def test_method_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: response = await async_client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert response.is_closed is True @@ -279,9 +279,9 @@ async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> None: async with async_client.models.versions.with_streaming_response.delete( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -296,32 +296,32 @@ async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> async def test_path_params_delete(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.versions.with_raw_response.delete( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): await async_client.models.versions.with_raw_response.delete( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: version = await async_client.models.versions.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert version is None @@ -329,9 +329,9 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) assert response.is_closed is True @@ -343,9 +343,9 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.models.versions.with_streaming_response.get( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -360,21 +360,21 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.versions.with_raw_response.get( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): await async_client.models.versions.with_raw_response.get( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", ) diff --git a/tests/api_resources/test_collections.py b/tests/api_resources/test_collections.py index 50ceede..0fe096b 100644 --- a/tests/api_resources/test_collections.py +++ b/tests/api_resources/test_collections.py @@ -47,7 +47,7 @@ def test_streaming_response_list(self, client: Replicate) -> None: @parametrize def test_method_get(self, client: Replicate) -> None: collection = client.collections.get( - "collection_slug", + collection_slug="collection_slug", ) assert collection is None @@ -55,7 +55,7 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.collections.with_raw_response.get( - "collection_slug", + collection_slug="collection_slug", ) assert response.is_closed is True @@ -67,7 +67,7 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.collections.with_streaming_response.get( - "collection_slug", + collection_slug="collection_slug", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -82,7 +82,7 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection_slug` but received ''"): client.collections.with_raw_response.get( - "", + collection_slug="", ) @@ -121,7 +121,7 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: collection = await async_client.collections.get( - "collection_slug", + collection_slug="collection_slug", ) assert collection is None @@ -129,7 +129,7 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.collections.with_raw_response.get( - "collection_slug", + collection_slug="collection_slug", ) assert response.is_closed is True @@ -141,7 +141,7 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.collections.with_streaming_response.get( - "collection_slug", + collection_slug="collection_slug", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,5 +156,5 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection_slug` but received ''"): await async_client.collections.with_raw_response.get( - "", + collection_slug="", ) diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py index 14c32af..39e1a92 100644 --- a/tests/api_resources/test_deployments.py +++ b/tests/api_resources/test_deployments.py @@ -76,8 +76,8 @@ def test_streaming_response_create(self, client: Replicate) -> None: @parametrize def test_method_update(self, client: Replicate) -> None: deployment = client.deployments.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert_matches_type(DeploymentUpdateResponse, deployment, path=["response"]) @@ -85,8 +85,8 @@ def test_method_update(self, client: Replicate) -> None: @parametrize def test_method_update_with_all_params(self, client: Replicate) -> None: deployment = client.deployments.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", hardware="hardware", max_instances=0, min_instances=0, @@ -98,8 +98,8 @@ def test_method_update_with_all_params(self, client: Replicate) -> None: @parametrize def test_raw_response_update(self, client: Replicate) -> None: response = client.deployments.with_raw_response.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -111,8 +111,8 @@ def test_raw_response_update(self, client: Replicate) -> None: @parametrize def test_streaming_response_update(self, client: Replicate) -> None: with client.deployments.with_streaming_response.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -127,14 +127,14 @@ def test_streaming_response_update(self, client: Replicate) -> None: def test_path_params_update(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): client.deployments.with_raw_response.update( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): client.deployments.with_raw_response.update( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) @pytest.mark.skip() @@ -169,8 +169,8 @@ def test_streaming_response_list(self, client: Replicate) -> None: @parametrize def test_method_delete(self, client: Replicate) -> None: deployment = client.deployments.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert deployment is None @@ -178,8 +178,8 @@ def test_method_delete(self, client: Replicate) -> None: @parametrize def test_raw_response_delete(self, client: Replicate) -> None: response = client.deployments.with_raw_response.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -191,8 +191,8 @@ def test_raw_response_delete(self, client: Replicate) -> None: @parametrize def test_streaming_response_delete(self, client: Replicate) -> None: with client.deployments.with_streaming_response.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -207,22 +207,22 @@ def test_streaming_response_delete(self, client: Replicate) -> None: def test_path_params_delete(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): client.deployments.with_raw_response.delete( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): client.deployments.with_raw_response.delete( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Replicate) -> None: deployment = client.deployments.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) @@ -230,8 +230,8 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.deployments.with_raw_response.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -243,8 +243,8 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.deployments.with_streaming_response.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -259,14 +259,14 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): client.deployments.with_raw_response.get( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): client.deployments.with_raw_response.get( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) @@ -326,8 +326,8 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) -> @parametrize async def test_method_update(self, async_client: AsyncReplicate) -> None: deployment = await async_client.deployments.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert_matches_type(DeploymentUpdateResponse, deployment, path=["response"]) @@ -335,8 +335,8 @@ async def test_method_update(self, async_client: AsyncReplicate) -> None: @parametrize async def test_method_update_with_all_params(self, async_client: AsyncReplicate) -> None: deployment = await async_client.deployments.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", hardware="hardware", max_instances=0, min_instances=0, @@ -348,8 +348,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncReplicate) @parametrize async def test_raw_response_update(self, async_client: AsyncReplicate) -> None: response = await async_client.deployments.with_raw_response.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -361,8 +361,8 @@ async def test_raw_response_update(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncReplicate) -> None: async with async_client.deployments.with_streaming_response.update( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -377,14 +377,14 @@ async def test_streaming_response_update(self, async_client: AsyncReplicate) -> async def test_path_params_update(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): await async_client.deployments.with_raw_response.update( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): await async_client.deployments.with_raw_response.update( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) @pytest.mark.skip() @@ -419,8 +419,8 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No @parametrize async def test_method_delete(self, async_client: AsyncReplicate) -> None: deployment = await async_client.deployments.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert deployment is None @@ -428,8 +428,8 @@ async def test_method_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: response = await async_client.deployments.with_raw_response.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -441,8 +441,8 @@ async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> None: async with async_client.deployments.with_streaming_response.delete( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -457,22 +457,22 @@ async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> async def test_path_params_delete(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): await async_client.deployments.with_raw_response.delete( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): await async_client.deployments.with_raw_response.delete( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: deployment = await async_client.deployments.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) @@ -480,8 +480,8 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.deployments.with_raw_response.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) assert response.is_closed is True @@ -493,8 +493,8 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.deployments.with_streaming_response.get( - deployment_name="deployment_name", deployment_owner="deployment_owner", + deployment_name="deployment_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -509,12 +509,12 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_owner` but received ''"): await async_client.deployments.with_raw_response.get( - deployment_name="deployment_name", deployment_owner="", + deployment_name="deployment_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_name` but received ''"): await async_client.deployments.with_raw_response.get( - deployment_name="", deployment_owner="deployment_owner", + deployment_name="", ) diff --git a/tests/api_resources/test_models.py b/tests/api_resources/test_models.py index ae56127..6743c9e 100644 --- a/tests/api_resources/test_models.py +++ b/tests/api_resources/test_models.py @@ -109,8 +109,8 @@ def test_streaming_response_list(self, client: Replicate) -> None: @parametrize def test_method_delete(self, client: Replicate) -> None: model = client.models.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert model is None @@ -118,8 +118,8 @@ def test_method_delete(self, client: Replicate) -> None: @parametrize def test_raw_response_delete(self, client: Replicate) -> None: response = client.models.with_raw_response.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -131,8 +131,8 @@ def test_raw_response_delete(self, client: Replicate) -> None: @parametrize def test_streaming_response_delete(self, client: Replicate) -> None: with client.models.with_streaming_response.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -147,22 +147,22 @@ def test_streaming_response_delete(self, client: Replicate) -> None: def test_path_params_delete(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.with_raw_response.delete( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.with_raw_response.delete( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Replicate) -> None: model = client.models.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert model is None @@ -170,8 +170,8 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.models.with_raw_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -183,8 +183,8 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.models.with_streaming_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -199,14 +199,14 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.models.with_raw_response.get( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.models.with_raw_response.get( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip(reason="Prism doesn't support query methods yet") @@ -338,8 +338,8 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No @parametrize async def test_method_delete(self, async_client: AsyncReplicate) -> None: model = await async_client.models.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert model is None @@ -347,8 +347,8 @@ async def test_method_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: response = await async_client.models.with_raw_response.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -360,8 +360,8 @@ async def test_raw_response_delete(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> None: async with async_client.models.with_streaming_response.delete( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -376,22 +376,22 @@ async def test_streaming_response_delete(self, async_client: AsyncReplicate) -> async def test_path_params_delete(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.with_raw_response.delete( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.with_raw_response.delete( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: model = await async_client.models.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert model is None @@ -399,8 +399,8 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.models.with_raw_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) assert response.is_closed is True @@ -412,8 +412,8 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.models.with_streaming_response.get( - model_name="model_name", model_owner="model_owner", + model_name="model_name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -428,14 +428,14 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.models.with_raw_response.get( - model_name="model_name", model_owner="", + model_name="model_name", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.models.with_raw_response.get( - model_name="", model_owner="model_owner", + model_name="", ) @pytest.mark.skip(reason="Prism doesn't support query methods yet") diff --git a/tests/api_resources/test_predictions.py b/tests/api_resources/test_predictions.py index a43f67e..550ed76 100644 --- a/tests/api_resources/test_predictions.py +++ b/tests/api_resources/test_predictions.py @@ -110,7 +110,7 @@ def test_streaming_response_list(self, client: Replicate) -> None: @parametrize def test_method_cancel(self, client: Replicate) -> None: prediction = client.predictions.cancel( - "prediction_id", + prediction_id="prediction_id", ) assert prediction is None @@ -118,7 +118,7 @@ def test_method_cancel(self, client: Replicate) -> None: @parametrize def test_raw_response_cancel(self, client: Replicate) -> None: response = client.predictions.with_raw_response.cancel( - "prediction_id", + prediction_id="prediction_id", ) assert response.is_closed is True @@ -130,7 +130,7 @@ def test_raw_response_cancel(self, client: Replicate) -> None: @parametrize def test_streaming_response_cancel(self, client: Replicate) -> None: with client.predictions.with_streaming_response.cancel( - "prediction_id", + prediction_id="prediction_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -145,14 +145,14 @@ def test_streaming_response_cancel(self, client: Replicate) -> None: def test_path_params_cancel(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prediction_id` but received ''"): client.predictions.with_raw_response.cancel( - "", + prediction_id="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Replicate) -> None: prediction = client.predictions.get( - "prediction_id", + prediction_id="prediction_id", ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -160,7 +160,7 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.predictions.with_raw_response.get( - "prediction_id", + prediction_id="prediction_id", ) assert response.is_closed is True @@ -172,7 +172,7 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.predictions.with_streaming_response.get( - "prediction_id", + prediction_id="prediction_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -187,7 +187,7 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prediction_id` but received ''"): client.predictions.with_raw_response.get( - "", + prediction_id="", ) @@ -285,7 +285,7 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No @parametrize async def test_method_cancel(self, async_client: AsyncReplicate) -> None: prediction = await async_client.predictions.cancel( - "prediction_id", + prediction_id="prediction_id", ) assert prediction is None @@ -293,7 +293,7 @@ async def test_method_cancel(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_cancel(self, async_client: AsyncReplicate) -> None: response = await async_client.predictions.with_raw_response.cancel( - "prediction_id", + prediction_id="prediction_id", ) assert response.is_closed is True @@ -305,7 +305,7 @@ async def test_raw_response_cancel(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncReplicate) -> None: async with async_client.predictions.with_streaming_response.cancel( - "prediction_id", + prediction_id="prediction_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -320,14 +320,14 @@ async def test_streaming_response_cancel(self, async_client: AsyncReplicate) -> async def test_path_params_cancel(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prediction_id` but received ''"): await async_client.predictions.with_raw_response.cancel( - "", + prediction_id="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: prediction = await async_client.predictions.get( - "prediction_id", + prediction_id="prediction_id", ) assert_matches_type(Prediction, prediction, path=["response"]) @@ -335,7 +335,7 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.predictions.with_raw_response.get( - "prediction_id", + prediction_id="prediction_id", ) assert response.is_closed is True @@ -347,7 +347,7 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.predictions.with_streaming_response.get( - "prediction_id", + prediction_id="prediction_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -362,5 +362,5 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `prediction_id` but received ''"): await async_client.predictions.with_raw_response.get( - "", + prediction_id="", ) diff --git a/tests/api_resources/test_trainings.py b/tests/api_resources/test_trainings.py index 9e006d3..3acb09b 100644 --- a/tests/api_resources/test_trainings.py +++ b/tests/api_resources/test_trainings.py @@ -27,9 +27,9 @@ class TestTrainings: @parametrize def test_method_create(self, client: Replicate) -> None: training = client.trainings.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) @@ -39,9 +39,9 @@ def test_method_create(self, client: Replicate) -> None: @parametrize def test_method_create_with_all_params(self, client: Replicate) -> None: training = client.trainings.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, webhook="webhook", @@ -53,9 +53,9 @@ def test_method_create_with_all_params(self, client: Replicate) -> None: @parametrize def test_raw_response_create(self, client: Replicate) -> None: response = client.trainings.with_raw_response.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) @@ -69,9 +69,9 @@ def test_raw_response_create(self, client: Replicate) -> None: @parametrize def test_streaming_response_create(self, client: Replicate) -> None: with client.trainings.with_streaming_response.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) as response: @@ -88,27 +88,27 @@ def test_streaming_response_create(self, client: Replicate) -> None: def test_path_params_create(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): client.trainings.with_raw_response.create( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.trainings.with_raw_response.create( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", destination="destination", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): client.trainings.with_raw_response.create( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", destination="destination", input={}, ) @@ -145,7 +145,7 @@ def test_streaming_response_list(self, client: Replicate) -> None: @parametrize def test_method_cancel(self, client: Replicate) -> None: training = client.trainings.cancel( - "training_id", + training_id="training_id", ) assert_matches_type(TrainingCancelResponse, training, path=["response"]) @@ -153,7 +153,7 @@ def test_method_cancel(self, client: Replicate) -> None: @parametrize def test_raw_response_cancel(self, client: Replicate) -> None: response = client.trainings.with_raw_response.cancel( - "training_id", + training_id="training_id", ) assert response.is_closed is True @@ -165,7 +165,7 @@ def test_raw_response_cancel(self, client: Replicate) -> None: @parametrize def test_streaming_response_cancel(self, client: Replicate) -> None: with client.trainings.with_streaming_response.cancel( - "training_id", + training_id="training_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -180,14 +180,14 @@ def test_streaming_response_cancel(self, client: Replicate) -> None: def test_path_params_cancel(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `training_id` but received ''"): client.trainings.with_raw_response.cancel( - "", + training_id="", ) @pytest.mark.skip() @parametrize def test_method_get(self, client: Replicate) -> None: training = client.trainings.get( - "training_id", + training_id="training_id", ) assert_matches_type(TrainingGetResponse, training, path=["response"]) @@ -195,7 +195,7 @@ def test_method_get(self, client: Replicate) -> None: @parametrize def test_raw_response_get(self, client: Replicate) -> None: response = client.trainings.with_raw_response.get( - "training_id", + training_id="training_id", ) assert response.is_closed is True @@ -207,7 +207,7 @@ def test_raw_response_get(self, client: Replicate) -> None: @parametrize def test_streaming_response_get(self, client: Replicate) -> None: with client.trainings.with_streaming_response.get( - "training_id", + training_id="training_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -222,7 +222,7 @@ def test_streaming_response_get(self, client: Replicate) -> None: def test_path_params_get(self, client: Replicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `training_id` but received ''"): client.trainings.with_raw_response.get( - "", + training_id="", ) @@ -233,9 +233,9 @@ class TestAsyncTrainings: @parametrize async def test_method_create(self, async_client: AsyncReplicate) -> None: training = await async_client.trainings.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) @@ -245,9 +245,9 @@ async def test_method_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncReplicate) -> None: training = await async_client.trainings.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, webhook="webhook", @@ -259,9 +259,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncReplicate) @parametrize async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: response = await async_client.trainings.with_raw_response.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) @@ -275,9 +275,9 @@ async def test_raw_response_create(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncReplicate) -> None: async with async_client.trainings.with_streaming_response.create( - version_id="version_id", model_owner="model_owner", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) as response: @@ -294,27 +294,27 @@ async def test_streaming_response_create(self, async_client: AsyncReplicate) -> async def test_path_params_create(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_owner` but received ''"): await async_client.trainings.with_raw_response.create( - version_id="version_id", model_owner="", model_name="model_name", + version_id="version_id", destination="destination", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.trainings.with_raw_response.create( - version_id="version_id", model_owner="model_owner", model_name="", + version_id="version_id", destination="destination", input={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `version_id` but received ''"): await async_client.trainings.with_raw_response.create( - version_id="", model_owner="model_owner", model_name="model_name", + version_id="", destination="destination", input={}, ) @@ -351,7 +351,7 @@ async def test_streaming_response_list(self, async_client: AsyncReplicate) -> No @parametrize async def test_method_cancel(self, async_client: AsyncReplicate) -> None: training = await async_client.trainings.cancel( - "training_id", + training_id="training_id", ) assert_matches_type(TrainingCancelResponse, training, path=["response"]) @@ -359,7 +359,7 @@ async def test_method_cancel(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_cancel(self, async_client: AsyncReplicate) -> None: response = await async_client.trainings.with_raw_response.cancel( - "training_id", + training_id="training_id", ) assert response.is_closed is True @@ -371,7 +371,7 @@ async def test_raw_response_cancel(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncReplicate) -> None: async with async_client.trainings.with_streaming_response.cancel( - "training_id", + training_id="training_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -386,14 +386,14 @@ async def test_streaming_response_cancel(self, async_client: AsyncReplicate) -> async def test_path_params_cancel(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `training_id` but received ''"): await async_client.trainings.with_raw_response.cancel( - "", + training_id="", ) @pytest.mark.skip() @parametrize async def test_method_get(self, async_client: AsyncReplicate) -> None: training = await async_client.trainings.get( - "training_id", + training_id="training_id", ) assert_matches_type(TrainingGetResponse, training, path=["response"]) @@ -401,7 +401,7 @@ async def test_method_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: response = await async_client.trainings.with_raw_response.get( - "training_id", + training_id="training_id", ) assert response.is_closed is True @@ -413,7 +413,7 @@ async def test_raw_response_get(self, async_client: AsyncReplicate) -> None: @parametrize async def test_streaming_response_get(self, async_client: AsyncReplicate) -> None: async with async_client.trainings.with_streaming_response.get( - "training_id", + training_id="training_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -428,5 +428,5 @@ async def test_streaming_response_get(self, async_client: AsyncReplicate) -> Non async def test_path_params_get(self, async_client: AsyncReplicate) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `training_id` but received ''"): await async_client.trainings.with_raw_response.get( - "", + training_id="", )