Skip to content

Commit cfdea3b

Browse files
feat(api): Mark search and extract as deprecated
1 parent 190be00 commit cfdea3b

3 files changed

Lines changed: 190 additions & 135 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 24
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-57e1c56be0942c131ab5f24d8620de166d0721ef7f3423532abc7027e5a989e7.yml
33
openapi_spec_hash: e61f831e30d19590eb3138a1b1709d1d
4-
config_hash: 80e7ee7ad8e3424616aca7189ffd5ae7
4+
config_hash: e17d82e9cb35004e5f9a9d3c4cf51aeb

src/parallel/resources/beta/beta.py

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing import List, Optional
67
from itertools import chain
78
from typing_extensions import Literal
@@ -113,6 +114,9 @@ def with_streaming_response(self) -> BetaResourceWithStreamingResponse:
113114
"""
114115
return BetaResourceWithStreamingResponse(self)
115116

117+
@typing_extensions.deprecated(
118+
"Use client.extract instead. For more info, see https://docs.parallel.ai/extract/extract-migration-guide"
119+
)
116120
def extract(
117121
self,
118122
*,
@@ -196,6 +200,9 @@ def extract(
196200
cast_to=ExtractResponse,
197201
)
198202

203+
@typing_extensions.deprecated(
204+
"Use client.search instead. For more info, see https://docs.parallel.ai/search/search-migration-guide"
205+
)
199206
def search(
200207
self,
201208
*,
@@ -364,6 +371,9 @@ def with_streaming_response(self) -> AsyncBetaResourceWithStreamingResponse:
364371
"""
365372
return AsyncBetaResourceWithStreamingResponse(self)
366373

374+
@typing_extensions.deprecated(
375+
"Use client.extract instead. For more info, see https://docs.parallel.ai/extract/extract-migration-guide"
376+
)
367377
async def extract(
368378
self,
369379
*,
@@ -447,6 +457,9 @@ async def extract(
447457
cast_to=ExtractResponse,
448458
)
449459

460+
@typing_extensions.deprecated(
461+
"Use client.search instead. For more info, see https://docs.parallel.ai/search/search-migration-guide"
462+
)
450463
async def search(
451464
self,
452465
*,
@@ -560,11 +573,15 @@ class BetaResourceWithRawResponse:
560573
def __init__(self, beta: BetaResource) -> None:
561574
self._beta = beta
562575

563-
self.extract = to_raw_response_wrapper(
564-
beta.extract,
576+
self.extract = ( # pyright: ignore[reportDeprecated]
577+
to_raw_response_wrapper(
578+
beta.extract, # pyright: ignore[reportDeprecated],
579+
)
565580
)
566-
self.search = to_raw_response_wrapper(
567-
beta.search,
581+
self.search = ( # pyright: ignore[reportDeprecated]
582+
to_raw_response_wrapper(
583+
beta.search, # pyright: ignore[reportDeprecated],
584+
)
568585
)
569586

570587
@cached_property
@@ -611,11 +628,15 @@ class AsyncBetaResourceWithRawResponse:
611628
def __init__(self, beta: AsyncBetaResource) -> None:
612629
self._beta = beta
613630

614-
self.extract = async_to_raw_response_wrapper(
615-
beta.extract,
631+
self.extract = ( # pyright: ignore[reportDeprecated]
632+
async_to_raw_response_wrapper(
633+
beta.extract, # pyright: ignore[reportDeprecated],
634+
)
616635
)
617-
self.search = async_to_raw_response_wrapper(
618-
beta.search,
636+
self.search = ( # pyright: ignore[reportDeprecated]
637+
async_to_raw_response_wrapper(
638+
beta.search, # pyright: ignore[reportDeprecated],
639+
)
619640
)
620641

621642
@cached_property
@@ -662,11 +683,15 @@ class BetaResourceWithStreamingResponse:
662683
def __init__(self, beta: BetaResource) -> None:
663684
self._beta = beta
664685

665-
self.extract = to_streamed_response_wrapper(
666-
beta.extract,
686+
self.extract = ( # pyright: ignore[reportDeprecated]
687+
to_streamed_response_wrapper(
688+
beta.extract, # pyright: ignore[reportDeprecated],
689+
)
667690
)
668-
self.search = to_streamed_response_wrapper(
669-
beta.search,
691+
self.search = ( # pyright: ignore[reportDeprecated]
692+
to_streamed_response_wrapper(
693+
beta.search, # pyright: ignore[reportDeprecated],
694+
)
670695
)
671696

672697
@cached_property
@@ -713,11 +738,15 @@ class AsyncBetaResourceWithStreamingResponse:
713738
def __init__(self, beta: AsyncBetaResource) -> None:
714739
self._beta = beta
715740

716-
self.extract = async_to_streamed_response_wrapper(
717-
beta.extract,
741+
self.extract = ( # pyright: ignore[reportDeprecated]
742+
async_to_streamed_response_wrapper(
743+
beta.extract, # pyright: ignore[reportDeprecated],
744+
)
718745
)
719-
self.search = async_to_streamed_response_wrapper(
720-
beta.search,
746+
self.search = ( # pyright: ignore[reportDeprecated]
747+
async_to_streamed_response_wrapper(
748+
beta.search, # pyright: ignore[reportDeprecated],
749+
)
721750
)
722751

723752
@cached_property

0 commit comments

Comments
 (0)