Skip to content

Commit e0976a1

Browse files
fix(api): re-add deprecated max_chars_per_result
1 parent 1d7200a commit e0976a1

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 13
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-40c12295a3f32ed93d58b523bb28f33ceabe8e6bfa8c44d5f863ed9c77feff58.yml
3-
openapi_spec_hash: 9f3cd99867507ada834db61c6d8391b9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-75b88aac7d973b5965b0ff4c6b16264a2b9051e0b156943931c1f28fe2b4777b.yml
3+
openapi_spec_hash: dc891ed9f9ca1172750db864a883f646
44
config_hash: 677d555754b79eb922f6bf64bccd9559

src/parallel/resources/beta/beta.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def search(
154154
*,
155155
excerpts: ExcerptSettingsParam | Omit = omit,
156156
fetch_policy: Optional[FetchPolicyParam] | Omit = omit,
157+
max_chars_per_result: Optional[int] | Omit = omit,
157158
max_results: Optional[int] | Omit = omit,
158159
mode: Optional[Literal["one-shot", "agentic"]] | Omit = omit,
159160
objective: Optional[str] | Omit = omit,
@@ -182,6 +183,10 @@ def search(
182183
live content (fresher). The default policy for search uses cached results only,
183184
while extract uses a dynamic policy based on the search objective and url.
184185
186+
max_chars_per_result: Optional upper bound on the total number of characters to include per url.
187+
Excerpts may contain fewer characters than this limit to maximize relevance and
188+
token efficiency.
189+
185190
max_results: Upper bound on the number of results to return. May be limited by the processor.
186191
Defaults to 10 if not provided.
187192
@@ -229,6 +234,7 @@ def search(
229234
{
230235
"excerpts": excerpts,
231236
"fetch_policy": fetch_policy,
237+
"max_chars_per_result": max_chars_per_result,
232238
"max_results": max_results,
233239
"mode": mode,
234240
"objective": objective,
@@ -352,6 +358,7 @@ async def search(
352358
*,
353359
excerpts: ExcerptSettingsParam | Omit = omit,
354360
fetch_policy: Optional[FetchPolicyParam] | Omit = omit,
361+
max_chars_per_result: Optional[int] | Omit = omit,
355362
max_results: Optional[int] | Omit = omit,
356363
mode: Optional[Literal["one-shot", "agentic"]] | Omit = omit,
357364
objective: Optional[str] | Omit = omit,
@@ -380,6 +387,10 @@ async def search(
380387
live content (fresher). The default policy for search uses cached results only,
381388
while extract uses a dynamic policy based on the search objective and url.
382389
390+
max_chars_per_result: Optional upper bound on the total number of characters to include per url.
391+
Excerpts may contain fewer characters than this limit to maximize relevance and
392+
token efficiency.
393+
383394
max_results: Upper bound on the number of results to return. May be limited by the processor.
384395
Defaults to 10 if not provided.
385396
@@ -427,6 +438,7 @@ async def search(
427438
{
428439
"excerpts": excerpts,
429440
"fetch_policy": fetch_policy,
441+
"max_chars_per_result": max_chars_per_result,
430442
"max_results": max_results,
431443
"mode": mode,
432444
"objective": objective,

src/parallel/types/beta/beta_search_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class BetaSearchParams(TypedDict, total=False):
2727
while extract uses a dynamic policy based on the search objective and url.
2828
"""
2929

30+
max_chars_per_result: Optional[int]
31+
"""Optional upper bound on the total number of characters to include per url.
32+
33+
Excerpts may contain fewer characters than this limit to maximize relevance and
34+
token efficiency.
35+
"""
36+
3037
max_results: Optional[int]
3138
"""Upper bound on the number of results to return.
3239

tests/api_resources/test_beta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_method_search_with_all_params(self, client: Parallel) -> None:
8585
"max_age_seconds": 86400,
8686
"timeout_seconds": 60,
8787
},
88+
max_chars_per_result=0,
8889
max_results=0,
8990
mode="one-shot",
9091
objective="objective",
@@ -188,6 +189,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncParallel)
188189
"max_age_seconds": 86400,
189190
"timeout_seconds": 60,
190191
},
192+
max_chars_per_result=0,
191193
max_results=0,
192194
mode="one-shot",
193195
objective="objective",

0 commit comments

Comments
 (0)