22
33from __future__ import annotations
44
5+ import typing_extensions
56from typing import List , Optional
67from itertools import chain
78from typing_extensions import Literal
@@ -113,10 +114,14 @@ 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 * ,
119123 urls : SequenceNotStr [str ],
124+ client_model : Optional [str ] | Omit = omit ,
120125 excerpts : beta_extract_params .Excerpts | Omit = omit ,
121126 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
122127 full_content : beta_extract_params .FullContent | Omit = omit ,
@@ -138,6 +143,9 @@ def extract(
138143 `search-extract-2025-10-10`.
139144
140145 Args:
146+ client_model: The model generating this request and consuming the results. Enables
147+ optimizations and tailors default settings for the model's capabilities.
148+
141149 excerpts: Include excerpts from each URL relevant to the search objective and queries.
142150 Note that if neither objective nor search_queries is provided, excerpts are
143151 redundant with full content.
@@ -181,6 +189,7 @@ def extract(
181189 body = maybe_transform (
182190 {
183191 "urls" : urls ,
192+ "client_model" : client_model ,
184193 "excerpts" : excerpts ,
185194 "fetch_policy" : fetch_policy ,
186195 "full_content" : full_content ,
@@ -196,9 +205,13 @@ def extract(
196205 cast_to = ExtractResponse ,
197206 )
198207
208+ @typing_extensions .deprecated (
209+ "Use client.search instead. For more info, see https://docs.parallel.ai/search/search-migration-guide"
210+ )
199211 def search (
200212 self ,
201213 * ,
214+ client_model : Optional [str ] | Omit = omit ,
202215 excerpts : ExcerptSettingsParam | Omit = omit ,
203216 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
204217 location : Optional [str ] | Omit = omit ,
@@ -222,6 +235,9 @@ def search(
222235 Searches the web.
223236
224237 Args:
238+ client_model: The model generating this request and consuming the results. Enables
239+ optimizations and tailors default settings for the model's capabilities.
240+
225241 excerpts: Optional settings to configure excerpt generation.
226242
227243 fetch_policy: Policy for live fetching web results.
@@ -284,6 +300,7 @@ def search(
284300 "/v1beta/search" ,
285301 body = maybe_transform (
286302 {
303+ "client_model" : client_model ,
287304 "excerpts" : excerpts ,
288305 "fetch_policy" : fetch_policy ,
289306 "location" : location ,
@@ -364,10 +381,14 @@ def with_streaming_response(self) -> AsyncBetaResourceWithStreamingResponse:
364381 """
365382 return AsyncBetaResourceWithStreamingResponse (self )
366383
384+ @typing_extensions .deprecated (
385+ "Use client.extract instead. For more info, see https://docs.parallel.ai/extract/extract-migration-guide"
386+ )
367387 async def extract (
368388 self ,
369389 * ,
370390 urls : SequenceNotStr [str ],
391+ client_model : Optional [str ] | Omit = omit ,
371392 excerpts : beta_extract_params .Excerpts | Omit = omit ,
372393 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
373394 full_content : beta_extract_params .FullContent | Omit = omit ,
@@ -389,6 +410,9 @@ async def extract(
389410 `search-extract-2025-10-10`.
390411
391412 Args:
413+ client_model: The model generating this request and consuming the results. Enables
414+ optimizations and tailors default settings for the model's capabilities.
415+
392416 excerpts: Include excerpts from each URL relevant to the search objective and queries.
393417 Note that if neither objective nor search_queries is provided, excerpts are
394418 redundant with full content.
@@ -432,6 +456,7 @@ async def extract(
432456 body = await async_maybe_transform (
433457 {
434458 "urls" : urls ,
459+ "client_model" : client_model ,
435460 "excerpts" : excerpts ,
436461 "fetch_policy" : fetch_policy ,
437462 "full_content" : full_content ,
@@ -447,9 +472,13 @@ async def extract(
447472 cast_to = ExtractResponse ,
448473 )
449474
475+ @typing_extensions .deprecated (
476+ "Use client.search instead. For more info, see https://docs.parallel.ai/search/search-migration-guide"
477+ )
450478 async def search (
451479 self ,
452480 * ,
481+ client_model : Optional [str ] | Omit = omit ,
453482 excerpts : ExcerptSettingsParam | Omit = omit ,
454483 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
455484 location : Optional [str ] | Omit = omit ,
@@ -473,6 +502,9 @@ async def search(
473502 Searches the web.
474503
475504 Args:
505+ client_model: The model generating this request and consuming the results. Enables
506+ optimizations and tailors default settings for the model's capabilities.
507+
476508 excerpts: Optional settings to configure excerpt generation.
477509
478510 fetch_policy: Policy for live fetching web results.
@@ -535,6 +567,7 @@ async def search(
535567 "/v1beta/search" ,
536568 body = await async_maybe_transform (
537569 {
570+ "client_model" : client_model ,
538571 "excerpts" : excerpts ,
539572 "fetch_policy" : fetch_policy ,
540573 "location" : location ,
@@ -560,11 +593,15 @@ class BetaResourceWithRawResponse:
560593 def __init__ (self , beta : BetaResource ) -> None :
561594 self ._beta = beta
562595
563- self .extract = to_raw_response_wrapper (
564- beta .extract ,
596+ self .extract = ( # pyright: ignore[reportDeprecated]
597+ to_raw_response_wrapper (
598+ beta .extract , # pyright: ignore[reportDeprecated],
599+ )
565600 )
566- self .search = to_raw_response_wrapper (
567- beta .search ,
601+ self .search = ( # pyright: ignore[reportDeprecated]
602+ to_raw_response_wrapper (
603+ beta .search , # pyright: ignore[reportDeprecated],
604+ )
568605 )
569606
570607 @cached_property
@@ -611,11 +648,15 @@ class AsyncBetaResourceWithRawResponse:
611648 def __init__ (self , beta : AsyncBetaResource ) -> None :
612649 self ._beta = beta
613650
614- self .extract = async_to_raw_response_wrapper (
615- beta .extract ,
651+ self .extract = ( # pyright: ignore[reportDeprecated]
652+ async_to_raw_response_wrapper (
653+ beta .extract , # pyright: ignore[reportDeprecated],
654+ )
616655 )
617- self .search = async_to_raw_response_wrapper (
618- beta .search ,
656+ self .search = ( # pyright: ignore[reportDeprecated]
657+ async_to_raw_response_wrapper (
658+ beta .search , # pyright: ignore[reportDeprecated],
659+ )
619660 )
620661
621662 @cached_property
@@ -662,11 +703,15 @@ class BetaResourceWithStreamingResponse:
662703 def __init__ (self , beta : BetaResource ) -> None :
663704 self ._beta = beta
664705
665- self .extract = to_streamed_response_wrapper (
666- beta .extract ,
706+ self .extract = ( # pyright: ignore[reportDeprecated]
707+ to_streamed_response_wrapper (
708+ beta .extract , # pyright: ignore[reportDeprecated],
709+ )
667710 )
668- self .search = to_streamed_response_wrapper (
669- beta .search ,
711+ self .search = ( # pyright: ignore[reportDeprecated]
712+ to_streamed_response_wrapper (
713+ beta .search , # pyright: ignore[reportDeprecated],
714+ )
670715 )
671716
672717 @cached_property
@@ -713,11 +758,15 @@ class AsyncBetaResourceWithStreamingResponse:
713758 def __init__ (self , beta : AsyncBetaResource ) -> None :
714759 self ._beta = beta
715760
716- self .extract = async_to_streamed_response_wrapper (
717- beta .extract ,
761+ self .extract = ( # pyright: ignore[reportDeprecated]
762+ async_to_streamed_response_wrapper (
763+ beta .extract , # pyright: ignore[reportDeprecated],
764+ )
718765 )
719- self .search = async_to_streamed_response_wrapper (
720- beta .search ,
766+ self .search = ( # pyright: ignore[reportDeprecated]
767+ async_to_streamed_response_wrapper (
768+ beta .search , # pyright: ignore[reportDeprecated],
769+ )
721770 )
722771
723772 @cached_property
0 commit comments