Skip to content

Commit 9706153

Browse files
feat(api): api update
1 parent 457d382 commit 9706153

8 files changed

Lines changed: 97 additions & 24 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: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e26ac226a3cf6d02380f3df386077414dd424dbf35c7c40e02ba512eff1dff84.yml
3-
openapi_spec_hash: 077166ff05843544fbb4b519200ac9fc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-18e7692e180f911962f33787228afa2cf31f6c05ab23c6afb1ca4f82b108fba5.yml
3+
openapi_spec_hash: 865bd1e346267d1e33f8ca63963c6aa3
44
config_hash: 70354330f92ce169beabc98696ebb9a3

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

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ def screenshot(
182182
full_screenshot: Literal["true", "false"] | Omit = omit,
183183
max_age_ms: int | Omit = omit,
184184
page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit,
185-
prioritize: Literal["speed", "quality"] | Omit = omit,
186185
timeout_ms: int | Omit = omit,
187186
viewport: web_screenshot_params.Viewport | Omit = omit,
187+
wait_for_ms: int | Omit = omit,
188188
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
189189
# The extra values given here take precedence over values defined on the client or passed to this method.
190190
extra_headers: Headers | None = None,
@@ -218,16 +218,16 @@ def screenshot(
218218
provided, screenshots the main domain landing page. Only applicable when using
219219
'domain', not 'directUrl'.
220220
221-
prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for
222-
faster capture with basic quality. If 'quality', optimizes for higher quality
223-
with longer wait times. Defaults to 'quality' if not provided.
224-
225221
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
226222
than this value, it will be aborted with a 408 status code. Maximum allowed
227223
value is 300000ms (5 minutes).
228224
229225
viewport: Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
230226
227+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking
228+
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
229+
omitted.
230+
231231
extra_headers: Send extra headers
232232
233233
extra_query: Add additional query parameters to the request
@@ -250,9 +250,9 @@ def screenshot(
250250
"full_screenshot": full_screenshot,
251251
"max_age_ms": max_age_ms,
252252
"page": page,
253-
"prioritize": prioritize,
254253
"timeout_ms": timeout_ms,
255254
"viewport": viewport,
255+
"wait_for_ms": wait_for_ms,
256256
},
257257
web_screenshot_params.WebScreenshotParams,
258258
),
@@ -276,6 +276,7 @@ def web_crawl_md(
276276
timeout_ms: int | Omit = omit,
277277
url_regex: str | Omit = omit,
278278
use_main_content_only: bool | Omit = omit,
279+
wait_for_ms: int | Omit = omit,
279280
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
280281
# The extra values given here take precedence over values defined on the client or passed to this method.
281282
extra_headers: Headers | None = None,
@@ -324,6 +325,9 @@ def web_crawl_md(
324325
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
325326
navigation
326327
328+
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
329+
crawled page. Min: 0. Max: 30000 (30 seconds).
330+
327331
extra_headers: Send extra headers
328332
329333
extra_query: Add additional query parameters to the request
@@ -349,6 +353,7 @@ def web_crawl_md(
349353
"timeout_ms": timeout_ms,
350354
"url_regex": url_regex,
351355
"use_main_content_only": use_main_content_only,
356+
"wait_for_ms": wait_for_ms,
352357
},
353358
web_web_crawl_md_params.WebWebCrawlMdParams,
354359
),
@@ -366,6 +371,7 @@ def web_scrape_html(
366371
max_age_ms: int | Omit = omit,
367372
parse_pdf: bool | Omit = omit,
368373
timeout_ms: int | Omit = omit,
374+
wait_for_ms: int | Omit = omit,
369375
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
370376
# The extra values given here take precedence over values defined on the client or passed to this method.
371377
extra_headers: Headers | None = None,
@@ -393,6 +399,10 @@ def web_scrape_html(
393399
than this value, it will be aborted with a 408 status code. Maximum allowed
394400
value is 300000ms (5 minutes).
395401
402+
wait_for_ms:
403+
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
404+
30000 (30 seconds).
405+
396406
extra_headers: Send extra headers
397407
398408
extra_query: Add additional query parameters to the request
@@ -415,6 +425,7 @@ def web_scrape_html(
415425
"max_age_ms": max_age_ms,
416426
"parse_pdf": parse_pdf,
417427
"timeout_ms": timeout_ms,
428+
"wait_for_ms": wait_for_ms,
418429
},
419430
web_web_scrape_html_params.WebWebScrapeHTMLParams,
420431
),
@@ -429,6 +440,7 @@ def web_scrape_images(
429440
enrichment: web_web_scrape_images_params.Enrichment | Omit = omit,
430441
max_age_ms: int | Omit = omit,
431442
timeout_ms: int | Omit = omit,
443+
wait_for_ms: int | Omit = omit,
432444
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
433445
# The extra values given here take precedence over values defined on the client or passed to this method.
434446
extra_headers: Headers | None = None,
@@ -455,6 +467,9 @@ def web_scrape_images(
455467
than this value, it will be aborted with a 408 status code. Maximum allowed
456468
value is 300000ms (5 minutes).
457469
470+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
471+
collecting images. Min: 0. Max: 30000 (30 seconds).
472+
458473
extra_headers: Send extra headers
459474
460475
extra_query: Add additional query parameters to the request
@@ -476,6 +491,7 @@ def web_scrape_images(
476491
"enrichment": enrichment,
477492
"max_age_ms": max_age_ms,
478493
"timeout_ms": timeout_ms,
494+
"wait_for_ms": wait_for_ms,
479495
},
480496
web_web_scrape_images_params.WebWebScrapeImagesParams,
481497
),
@@ -495,6 +511,7 @@ def web_scrape_md(
495511
shorten_base64_images: bool | Omit = omit,
496512
timeout_ms: int | Omit = omit,
497513
use_main_content_only: bool | Omit = omit,
514+
wait_for_ms: int | Omit = omit,
498515
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
499516
# The extra values given here take precedence over values defined on the client or passed to this method.
500517
extra_headers: Headers | None = None,
@@ -532,6 +549,9 @@ def web_scrape_md(
532549
use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
533550
and navigation
534551
552+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
553+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
554+
535555
extra_headers: Send extra headers
536556
537557
extra_query: Add additional query parameters to the request
@@ -558,6 +578,7 @@ def web_scrape_md(
558578
"shorten_base64_images": shorten_base64_images,
559579
"timeout_ms": timeout_ms,
560580
"use_main_content_only": use_main_content_only,
581+
"wait_for_ms": wait_for_ms,
561582
},
562583
web_web_scrape_md_params.WebWebScrapeMdParams,
563584
),
@@ -767,9 +788,9 @@ async def screenshot(
767788
full_screenshot: Literal["true", "false"] | Omit = omit,
768789
max_age_ms: int | Omit = omit,
769790
page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit,
770-
prioritize: Literal["speed", "quality"] | Omit = omit,
771791
timeout_ms: int | Omit = omit,
772792
viewport: web_screenshot_params.Viewport | Omit = omit,
793+
wait_for_ms: int | Omit = omit,
773794
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
774795
# The extra values given here take precedence over values defined on the client or passed to this method.
775796
extra_headers: Headers | None = None,
@@ -803,16 +824,16 @@ async def screenshot(
803824
provided, screenshots the main domain landing page. Only applicable when using
804825
'domain', not 'directUrl'.
805826
806-
prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for
807-
faster capture with basic quality. If 'quality', optimizes for higher quality
808-
with longer wait times. Defaults to 'quality' if not provided.
809-
810827
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
811828
than this value, it will be aborted with a 408 status code. Maximum allowed
812829
value is 300000ms (5 minutes).
813830
814831
viewport: Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
815832
833+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking
834+
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
835+
omitted.
836+
816837
extra_headers: Send extra headers
817838
818839
extra_query: Add additional query parameters to the request
@@ -835,9 +856,9 @@ async def screenshot(
835856
"full_screenshot": full_screenshot,
836857
"max_age_ms": max_age_ms,
837858
"page": page,
838-
"prioritize": prioritize,
839859
"timeout_ms": timeout_ms,
840860
"viewport": viewport,
861+
"wait_for_ms": wait_for_ms,
841862
},
842863
web_screenshot_params.WebScreenshotParams,
843864
),
@@ -861,6 +882,7 @@ async def web_crawl_md(
861882
timeout_ms: int | Omit = omit,
862883
url_regex: str | Omit = omit,
863884
use_main_content_only: bool | Omit = omit,
885+
wait_for_ms: int | Omit = omit,
864886
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
865887
# The extra values given here take precedence over values defined on the client or passed to this method.
866888
extra_headers: Headers | None = None,
@@ -909,6 +931,9 @@ async def web_crawl_md(
909931
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
910932
navigation
911933
934+
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
935+
crawled page. Min: 0. Max: 30000 (30 seconds).
936+
912937
extra_headers: Send extra headers
913938
914939
extra_query: Add additional query parameters to the request
@@ -934,6 +959,7 @@ async def web_crawl_md(
934959
"timeout_ms": timeout_ms,
935960
"url_regex": url_regex,
936961
"use_main_content_only": use_main_content_only,
962+
"wait_for_ms": wait_for_ms,
937963
},
938964
web_web_crawl_md_params.WebWebCrawlMdParams,
939965
),
@@ -951,6 +977,7 @@ async def web_scrape_html(
951977
max_age_ms: int | Omit = omit,
952978
parse_pdf: bool | Omit = omit,
953979
timeout_ms: int | Omit = omit,
980+
wait_for_ms: int | Omit = omit,
954981
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
955982
# The extra values given here take precedence over values defined on the client or passed to this method.
956983
extra_headers: Headers | None = None,
@@ -978,6 +1005,10 @@ async def web_scrape_html(
9781005
than this value, it will be aborted with a 408 status code. Maximum allowed
9791006
value is 300000ms (5 minutes).
9801007
1008+
wait_for_ms:
1009+
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
1010+
30000 (30 seconds).
1011+
9811012
extra_headers: Send extra headers
9821013
9831014
extra_query: Add additional query parameters to the request
@@ -1000,6 +1031,7 @@ async def web_scrape_html(
10001031
"max_age_ms": max_age_ms,
10011032
"parse_pdf": parse_pdf,
10021033
"timeout_ms": timeout_ms,
1034+
"wait_for_ms": wait_for_ms,
10031035
},
10041036
web_web_scrape_html_params.WebWebScrapeHTMLParams,
10051037
),
@@ -1014,6 +1046,7 @@ async def web_scrape_images(
10141046
enrichment: web_web_scrape_images_params.Enrichment | Omit = omit,
10151047
max_age_ms: int | Omit = omit,
10161048
timeout_ms: int | Omit = omit,
1049+
wait_for_ms: int | Omit = omit,
10171050
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10181051
# The extra values given here take precedence over values defined on the client or passed to this method.
10191052
extra_headers: Headers | None = None,
@@ -1040,6 +1073,9 @@ async def web_scrape_images(
10401073
than this value, it will be aborted with a 408 status code. Maximum allowed
10411074
value is 300000ms (5 minutes).
10421075
1076+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
1077+
collecting images. Min: 0. Max: 30000 (30 seconds).
1078+
10431079
extra_headers: Send extra headers
10441080
10451081
extra_query: Add additional query parameters to the request
@@ -1061,6 +1097,7 @@ async def web_scrape_images(
10611097
"enrichment": enrichment,
10621098
"max_age_ms": max_age_ms,
10631099
"timeout_ms": timeout_ms,
1100+
"wait_for_ms": wait_for_ms,
10641101
},
10651102
web_web_scrape_images_params.WebWebScrapeImagesParams,
10661103
),
@@ -1080,6 +1117,7 @@ async def web_scrape_md(
10801117
shorten_base64_images: bool | Omit = omit,
10811118
timeout_ms: int | Omit = omit,
10821119
use_main_content_only: bool | Omit = omit,
1120+
wait_for_ms: int | Omit = omit,
10831121
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10841122
# The extra values given here take precedence over values defined on the client or passed to this method.
10851123
extra_headers: Headers | None = None,
@@ -1117,6 +1155,9 @@ async def web_scrape_md(
11171155
use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
11181156
and navigation
11191157
1158+
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
1159+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
1160+
11201161
extra_headers: Send extra headers
11211162
11221163
extra_query: Add additional query parameters to the request
@@ -1143,6 +1184,7 @@ async def web_scrape_md(
11431184
"shorten_base64_images": shorten_base64_images,
11441185
"timeout_ms": timeout_ms,
11451186
"use_main_content_only": use_main_content_only,
1187+
"wait_for_ms": wait_for_ms,
11461188
},
11471189
web_web_scrape_md_params.WebWebScrapeMdParams,
11481190
),

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ class WebScreenshotParams(TypedDict, total=False):
4747
applicable when using 'domain', not 'directUrl'.
4848
"""
4949

50-
prioritize: Literal["speed", "quality"]
51-
"""Optional parameter to prioritize screenshot capture.
52-
53-
If 'speed', optimizes for faster capture with basic quality. If 'quality',
54-
optimizes for higher quality with longer wait times. Defaults to 'quality' if
55-
not provided.
56-
"""
57-
5850
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
5951
"""Optional timeout in milliseconds for the request.
6052
@@ -65,6 +57,13 @@ class WebScreenshotParams(TypedDict, total=False):
6557
viewport: Viewport
6658
"""Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."""
6759

60+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
61+
"""
62+
Optional browser wait time in milliseconds after initial page load before taking
63+
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
64+
omitted.
65+
"""
66+
6867

6968
class Viewport(TypedDict, total=False):
7069
"""Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."""

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,9 @@ class WebWebCrawlMdParams(TypedDict, total=False):
7070
Extract only the main content, stripping headers, footers, sidebars, and
7171
navigation
7272
"""
73+
74+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
75+
"""
76+
Optional browser wait time in milliseconds after initial page load for each
77+
crawled page. Min: 0. Max: 30000 (30 seconds).
78+
"""

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
3636
If the request takes longer than this value, it will be aborted with a 408
3737
status code. Maximum allowed value is 300000ms (5 minutes).
3838
"""
39+
40+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
41+
"""Optional browser wait time in milliseconds after initial page load.
42+
43+
Min: 0. Max: 30000 (30 seconds).
44+
"""

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class WebWebScrapeImagesParams(TypedDict, total=False):
3333
status code. Maximum allowed value is 300000ms (5 minutes).
3434
"""
3535

36+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
37+
"""
38+
Optional browser wait time in milliseconds after initial page load before
39+
collecting images. Min: 0. Max: 30000 (30 seconds).
40+
"""
41+
3642

3743
class Enrichment(TypedDict, total=False):
3844
"""

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ class WebWebScrapeMdParams(TypedDict, total=False):
5454
Extract only the main content of the page, excluding headers, footers, sidebars,
5555
and navigation
5656
"""
57+
58+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
59+
"""
60+
Optional browser wait time in milliseconds after initial page load before
61+
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
62+
"""

0 commit comments

Comments
 (0)