Skip to content

Commit ca4de4e

Browse files
author
stlc-bot
committed
fix(api): reject timeoutMS too short for waitForMs
Stainless-Generated-From: 7abe10b7ac6df0a72f76b9ae3280bdd25f61c86b
1 parent 1bdb240 commit ca4de4e

5 files changed

Lines changed: 33 additions & 12 deletions

File tree

‎src/context/dev/resources/web.py‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ def screenshot(
681681
682682
wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking
683683
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
684-
omitted.
684+
omitted. When combined with timeoutMS, timeoutMS must be at least waitForMs +
685+
10000 ms; a shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
685686
686687
zdr: Set to enabled to bypass shared caches and omit request and response content
687688
from retained usage logs. Requires zero data retention to be enabled for your
@@ -1684,7 +1685,9 @@ def web_scrape_html(
16841685
16851686
wait_for_ms:
16861687
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
1687-
30000 (30 seconds).
1688+
30000 (30 seconds). When combined with timeoutMS, timeoutMS must be at least
1689+
waitForMs + 10000 ms; a shorter deadline is rejected with 400
1690+
TIMEOUT_TOO_SHORT_FOR_WAIT.
16881691
16891692
zdr: Set to enabled to bypass shared caches and omit request and response content
16901693
from retained usage logs. Requires zero data retention to be enabled for your
@@ -1786,7 +1789,9 @@ def web_scrape_images(
17861789
value is 300000ms (5 minutes).
17871790
17881791
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
1789-
collecting images. Min: 0. Max: 30000 (30 seconds).
1792+
collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
1793+
timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter deadline
1794+
is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
17901795
17911796
extra_headers: Send extra headers
17921797
@@ -2145,7 +2150,9 @@ def web_scrape_md(
21452150
and navigation
21462151
21472152
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
2148-
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
2153+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). When combined
2154+
with timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter
2155+
deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
21492156
21502157
zdr: Set to enabled to bypass shared caches and omit request and response content
21512158
from retained usage logs. Requires zero data retention to be enabled for your
@@ -2929,7 +2936,8 @@ async def screenshot(
29292936
29302937
wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking
29312938
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
2932-
omitted.
2939+
omitted. When combined with timeoutMS, timeoutMS must be at least waitForMs +
2940+
10000 ms; a shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
29332941
29342942
zdr: Set to enabled to bypass shared caches and omit request and response content
29352943
from retained usage logs. Requires zero data retention to be enabled for your
@@ -3932,7 +3940,9 @@ async def web_scrape_html(
39323940
39333941
wait_for_ms:
39343942
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
3935-
30000 (30 seconds).
3943+
30000 (30 seconds). When combined with timeoutMS, timeoutMS must be at least
3944+
waitForMs + 10000 ms; a shorter deadline is rejected with 400
3945+
TIMEOUT_TOO_SHORT_FOR_WAIT.
39363946
39373947
zdr: Set to enabled to bypass shared caches and omit request and response content
39383948
from retained usage logs. Requires zero data retention to be enabled for your
@@ -4034,7 +4044,9 @@ async def web_scrape_images(
40344044
value is 300000ms (5 minutes).
40354045
40364046
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
4037-
collecting images. Min: 0. Max: 30000 (30 seconds).
4047+
collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
4048+
timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter deadline
4049+
is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
40384050
40394051
extra_headers: Send extra headers
40404052
@@ -4393,7 +4405,9 @@ async def web_scrape_md(
43934405
and navigation
43944406
43954407
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
4396-
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
4408+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). When combined
4409+
with timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter
4410+
deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
43974411
43984412
zdr: Set to enabled to bypass shared caches and omit request and response content
43994413
from retained usage logs. Requires zero data retention to be enabled for your

‎src/context/dev/types/web_screenshot_params.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ class WebScreenshotParams(TypedDict, total=False):
312312
"""
313313
Optional browser wait time in milliseconds after initial page load before taking
314314
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
315-
omitted.
315+
omitted. When combined with timeoutMS, timeoutMS must be at least waitForMs +
316+
10000 ms; a shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
316317
"""
317318

318319
zdr: Literal["enabled", "disabled"]

‎src/context/dev/types/web_web_scrape_html_params.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
308308
wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")]
309309
"""Optional browser wait time in milliseconds after initial page load.
310310
311-
Min: 0. Max: 30000 (30 seconds).
311+
Min: 0. Max: 30000 (30 seconds). When combined with timeoutMS, timeoutMS must be
312+
at least waitForMs + 10000 ms; a shorter deadline is rejected with 400
313+
TIMEOUT_TOO_SHORT_FOR_WAIT.
312314
"""
313315

314316
zdr: Literal["enabled", "disabled"]

‎src/context/dev/types/web_web_scrape_images_params.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ class WebWebScrapeImagesParams(TypedDict, total=False):
7373
wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")]
7474
"""
7575
Optional browser wait time in milliseconds after initial page load before
76-
collecting images. Min: 0. Max: 30000 (30 seconds).
76+
collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
77+
timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter deadline
78+
is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
7779
"""
7880

7981

‎src/context/dev/types/web_web_scrape_md_params.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ class WebWebScrapeMdParams(TypedDict, total=False):
327327
wait_for_ms: Annotated[Optional[int], PropertyInfo(alias="waitForMs")]
328328
"""
329329
Optional browser wait time in milliseconds after initial page load before
330-
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
330+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). When combined
331+
with timeoutMS, timeoutMS must be at least waitForMs + 10000 ms; a shorter
332+
deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
331333
"""
332334

333335
zdr: Literal["enabled", "disabled"]

0 commit comments

Comments
 (0)