4040from ...types .beta .extract_response import ExtractResponse
4141from ...types .beta .fetch_policy_param import FetchPolicyParam
4242from ...types .beta .parallel_beta_param import ParallelBetaParam
43+ from ...types .beta .excerpt_settings_param import ExcerptSettingsParam
4344from ...types .shared_params .source_policy import SourcePolicy
4445
4546__all__ = ["BetaResource" , "AsyncBetaResource" ]
@@ -77,12 +78,12 @@ def extract(
7778 self ,
7879 * ,
7980 urls : SequenceNotStr [str ],
81+ betas : List [ParallelBetaParam ],
8082 excerpts : beta_extract_params .Excerpts | Omit = omit ,
8183 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
8284 full_content : beta_extract_params .FullContent | Omit = omit ,
8385 objective : Optional [str ] | Omit = omit ,
8486 search_queries : Optional [SequenceNotStr [str ]] | Omit = omit ,
85- betas : List [ParallelBetaParam ] | Omit = omit ,
8687 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8788 # The extra values given here take precedence over values defined on the client or passed to this method.
8889 extra_headers : Headers | None = None ,
@@ -97,14 +98,17 @@ def extract(
9798 `search-extract-2025-10-10`.
9899
99100 Args:
101+ betas: Optional header to specify the beta version(s) to enable.
102+
100103 excerpts: Include excerpts from each URL relevant to the search objective and queries.
101104 Note that if neither objective nor search_queries is provided, excerpts are
102105 redundant with full content.
103106
104- fetch_policy: Fetch policy .
107+ fetch_policy: Policy for live fetching web results .
105108
106- Determines when to return content from the cache (faster) vs fetching live
107- content (fresher).
109+ Determines when to return cached content from the index (faster) vs fetching
110+ live content (fresher). The default policy for search uses cached results only,
111+ while extract uses a dynamic policy based on the search objective and url.
108112
109113 full_content: Include full content from each URL. Note that if neither objective nor
110114 search_queries is provided, excerpts are redundant with full content.
@@ -113,8 +117,6 @@ def extract(
113117
114118 search_queries: If provided, focuses extracted content on the specified keyword search queries.
115119
116- betas: Optional header to specify the beta version(s) to enable.
117-
118120 extra_headers: Send extra headers
119121
120122 extra_query: Add additional query parameters to the request
@@ -124,16 +126,10 @@ def extract(
124126 timeout: Override the client-level default timeout for this request, in seconds
125127 """
126128 extra_headers = {
127- ** strip_not_given (
128- {
129- "parallel-beta" : "," .join (chain ((str (e ) for e in betas ), ["search-extract-2025-10-10" ]))
130- if is_given (betas )
131- else not_given
132- }
133- ),
129+ "parallel-beta" : "," .join (chain ((str (e ) for e in betas ), ["search-extract-2025-10-10" ])),
134130 ** (extra_headers or {}),
135131 }
136- extra_headers = {"parallel-beta" : "search-extract-2025-10-10" , ** ( extra_headers or {})}
132+ extra_headers . update ( {"parallel-beta" : "search-extract-2025-10-10" })
137133 return self ._post (
138134 "/v1beta/extract" ,
139135 body = maybe_transform (
@@ -156,10 +152,11 @@ def extract(
156152 def search (
157153 self ,
158154 * ,
159- max_chars_per_result : Optional [int ] | Omit = omit ,
155+ excerpts : ExcerptSettingsParam | Omit = omit ,
156+ fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
160157 max_results : Optional [int ] | Omit = omit ,
158+ mode : Optional [Literal ["one-shot" , "agentic" ]] | Omit = omit ,
161159 objective : Optional [str ] | Omit = omit ,
162- processor : Optional [Literal ["base" , "pro" ]] | Omit = omit ,
163160 search_queries : Optional [SequenceNotStr [str ]] | Omit = omit ,
164161 source_policy : Optional [SourcePolicy ] | Omit = omit ,
165162 betas : List [ParallelBetaParam ] | Omit = omit ,
@@ -173,19 +170,30 @@ def search(
173170 """
174171 Searches the web.
175172
173+ To access this endpoint, pass the `parallel-beta` header with the value
174+ `search-extract-2025-10-10`.
175+
176176 Args:
177- max_chars_per_result: Upper bound on the number of characters to include in excerpts for each search
178- result.
177+ excerpts: Optional settings for returning relevant excerpts.
178+
179+ fetch_policy: Policy for live fetching web results.
180+
181+ Determines when to return cached content from the index (faster) vs fetching
182+ live content (fresher). The default policy for search uses cached results only,
183+ while extract uses a dynamic policy based on the search objective and url.
179184
180185 max_results: Upper bound on the number of results to return. May be limited by the processor.
181186 Defaults to 10 if not provided.
182187
188+ mode: Presets default values for parameters for different use cases. `one-shot`
189+ returns more comprehensive results and longer excerpts to answer questions from
190+ a single response, while `agentic` returns more concise, token-efficient results
191+ for use in an agentic loop.
192+
183193 objective: Natural-language description of what the web search is trying to find. May
184194 include guidance about preferred sources or freshness. At least one of objective
185195 or search_queries must be provided.
186196
187- processor: Search processor.
188-
189197 search_queries: Optional list of traditional keyword search queries to guide the search. May
190198 contain search operators. At least one of objective or search_queries must be
191199 provided.
@@ -219,10 +227,11 @@ def search(
219227 "/v1beta/search" ,
220228 body = maybe_transform (
221229 {
222- "max_chars_per_result" : max_chars_per_result ,
230+ "excerpts" : excerpts ,
231+ "fetch_policy" : fetch_policy ,
223232 "max_results" : max_results ,
233+ "mode" : mode ,
224234 "objective" : objective ,
225- "processor" : processor ,
226235 "search_queries" : search_queries ,
227236 "source_policy" : source_policy ,
228237 },
@@ -267,12 +276,12 @@ async def extract(
267276 self ,
268277 * ,
269278 urls : SequenceNotStr [str ],
279+ betas : List [ParallelBetaParam ],
270280 excerpts : beta_extract_params .Excerpts | Omit = omit ,
271281 fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
272282 full_content : beta_extract_params .FullContent | Omit = omit ,
273283 objective : Optional [str ] | Omit = omit ,
274284 search_queries : Optional [SequenceNotStr [str ]] | Omit = omit ,
275- betas : List [ParallelBetaParam ] | Omit = omit ,
276285 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
277286 # The extra values given here take precedence over values defined on the client or passed to this method.
278287 extra_headers : Headers | None = None ,
@@ -287,14 +296,17 @@ async def extract(
287296 `search-extract-2025-10-10`.
288297
289298 Args:
299+ betas: Optional header to specify the beta version(s) to enable.
300+
290301 excerpts: Include excerpts from each URL relevant to the search objective and queries.
291302 Note that if neither objective nor search_queries is provided, excerpts are
292303 redundant with full content.
293304
294- fetch_policy: Fetch policy .
305+ fetch_policy: Policy for live fetching web results .
295306
296- Determines when to return content from the cache (faster) vs fetching live
297- content (fresher).
307+ Determines when to return cached content from the index (faster) vs fetching
308+ live content (fresher). The default policy for search uses cached results only,
309+ while extract uses a dynamic policy based on the search objective and url.
298310
299311 full_content: Include full content from each URL. Note that if neither objective nor
300312 search_queries is provided, excerpts are redundant with full content.
@@ -303,8 +315,6 @@ async def extract(
303315
304316 search_queries: If provided, focuses extracted content on the specified keyword search queries.
305317
306- betas: Optional header to specify the beta version(s) to enable.
307-
308318 extra_headers: Send extra headers
309319
310320 extra_query: Add additional query parameters to the request
@@ -314,16 +324,10 @@ async def extract(
314324 timeout: Override the client-level default timeout for this request, in seconds
315325 """
316326 extra_headers = {
317- ** strip_not_given (
318- {
319- "parallel-beta" : "," .join (chain ((str (e ) for e in betas ), ["search-extract-2025-10-10" ]))
320- if is_given (betas )
321- else not_given
322- }
323- ),
327+ "parallel-beta" : "," .join (chain ((str (e ) for e in betas ), ["search-extract-2025-10-10" ])),
324328 ** (extra_headers or {}),
325329 }
326- extra_headers = {"parallel-beta" : "search-extract-2025-10-10" , ** ( extra_headers or {})}
330+ extra_headers . update ( {"parallel-beta" : "search-extract-2025-10-10" })
327331 return await self ._post (
328332 "/v1beta/extract" ,
329333 body = await async_maybe_transform (
@@ -346,10 +350,11 @@ async def extract(
346350 async def search (
347351 self ,
348352 * ,
349- max_chars_per_result : Optional [int ] | Omit = omit ,
353+ excerpts : ExcerptSettingsParam | Omit = omit ,
354+ fetch_policy : Optional [FetchPolicyParam ] | Omit = omit ,
350355 max_results : Optional [int ] | Omit = omit ,
356+ mode : Optional [Literal ["one-shot" , "agentic" ]] | Omit = omit ,
351357 objective : Optional [str ] | Omit = omit ,
352- processor : Optional [Literal ["base" , "pro" ]] | Omit = omit ,
353358 search_queries : Optional [SequenceNotStr [str ]] | Omit = omit ,
354359 source_policy : Optional [SourcePolicy ] | Omit = omit ,
355360 betas : List [ParallelBetaParam ] | Omit = omit ,
@@ -363,19 +368,30 @@ async def search(
363368 """
364369 Searches the web.
365370
371+ To access this endpoint, pass the `parallel-beta` header with the value
372+ `search-extract-2025-10-10`.
373+
366374 Args:
367- max_chars_per_result: Upper bound on the number of characters to include in excerpts for each search
368- result.
375+ excerpts: Optional settings for returning relevant excerpts.
376+
377+ fetch_policy: Policy for live fetching web results.
378+
379+ Determines when to return cached content from the index (faster) vs fetching
380+ live content (fresher). The default policy for search uses cached results only,
381+ while extract uses a dynamic policy based on the search objective and url.
369382
370383 max_results: Upper bound on the number of results to return. May be limited by the processor.
371384 Defaults to 10 if not provided.
372385
386+ mode: Presets default values for parameters for different use cases. `one-shot`
387+ returns more comprehensive results and longer excerpts to answer questions from
388+ a single response, while `agentic` returns more concise, token-efficient results
389+ for use in an agentic loop.
390+
373391 objective: Natural-language description of what the web search is trying to find. May
374392 include guidance about preferred sources or freshness. At least one of objective
375393 or search_queries must be provided.
376394
377- processor: Search processor.
378-
379395 search_queries: Optional list of traditional keyword search queries to guide the search. May
380396 contain search operators. At least one of objective or search_queries must be
381397 provided.
@@ -409,10 +425,11 @@ async def search(
409425 "/v1beta/search" ,
410426 body = await async_maybe_transform (
411427 {
412- "max_chars_per_result" : max_chars_per_result ,
428+ "excerpts" : excerpts ,
429+ "fetch_policy" : fetch_policy ,
413430 "max_results" : max_results ,
431+ "mode" : mode ,
414432 "objective" : objective ,
415- "processor" : processor ,
416433 "search_queries" : search_queries ,
417434 "source_policy" : source_policy ,
418435 },
0 commit comments