99
1010from replicate import Replicate , AsyncReplicate
1111from tests .utils import assert_matches_type
12- from replicate .types import ModelGetResponse , ModelListResponse
12+ from replicate .types import (
13+ ModelGetResponse ,
14+ ModelListResponse ,
15+ ModelSearchResponse ,
16+ )
1317from replicate .pagination import SyncCursorURLPage , AsyncCursorURLPage
1418
1519base_url = os .environ .get ("TEST_API_BASE_URL" , "http://127.0.0.1:4010" )
@@ -215,7 +219,7 @@ def test_method_search(self, client: Replicate) -> None:
215219 model = client .models .search (
216220 body = "body" ,
217221 )
218- assert_matches_type (SyncCursorURLPage [object ], model , path = ["response" ])
222+ assert_matches_type (SyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
219223
220224 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
221225 @parametrize
@@ -227,7 +231,7 @@ def test_raw_response_search(self, client: Replicate) -> None:
227231 assert response .is_closed is True
228232 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
229233 model = response .parse ()
230- assert_matches_type (SyncCursorURLPage [object ], model , path = ["response" ])
234+ assert_matches_type (SyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
231235
232236 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
233237 @parametrize
@@ -239,7 +243,7 @@ def test_streaming_response_search(self, client: Replicate) -> None:
239243 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
240244
241245 model = response .parse ()
242- assert_matches_type (SyncCursorURLPage [object ], model , path = ["response" ])
246+ assert_matches_type (SyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
243247
244248 assert cast (Any , response .is_closed ) is True
245249
@@ -446,7 +450,7 @@ async def test_method_search(self, async_client: AsyncReplicate) -> None:
446450 model = await async_client .models .search (
447451 body = "body" ,
448452 )
449- assert_matches_type (AsyncCursorURLPage [object ], model , path = ["response" ])
453+ assert_matches_type (AsyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
450454
451455 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
452456 @parametrize
@@ -458,7 +462,7 @@ async def test_raw_response_search(self, async_client: AsyncReplicate) -> None:
458462 assert response .is_closed is True
459463 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
460464 model = await response .parse ()
461- assert_matches_type (AsyncCursorURLPage [object ], model , path = ["response" ])
465+ assert_matches_type (AsyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
462466
463467 @pytest .mark .skip (reason = "Prism doesn't support query methods yet" )
464468 @parametrize
@@ -470,6 +474,6 @@ async def test_streaming_response_search(self, async_client: AsyncReplicate) ->
470474 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
471475
472476 model = await response .parse ()
473- assert_matches_type (AsyncCursorURLPage [object ], model , path = ["response" ])
477+ assert_matches_type (AsyncCursorURLPage [ModelSearchResponse ], model , path = ["response" ])
474478
475479 assert cast (Any , response .is_closed ) is True
0 commit comments