Skip to content

Commit fd00858

Browse files
feat(api): api update
1 parent 789eb86 commit fd00858

6 files changed

Lines changed: 65 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: 36
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-66a3bf68b47ba61c9b61406d36f614a079ff752b8964a8df8062e485391d5598.yml
3-
openapi_spec_hash: b17d6cfe3710dd0605078f3907a1a419
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d71b08e421ccdda9a2754c307e97df0ee7444926306a00624dca2bc7d56548ac.yml
3+
openapi_spec_hash: ebfbed20b5837ccf8db8bb40ab23baac
44
config_hash: 7ec4851ee8d93177947e95df5ae897b5

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ def web_crawl_md(
12111211
max_depth: int | Omit = omit,
12121212
max_pages: int | Omit = omit,
12131213
pdf: web_web_crawl_md_params.Pdf | Omit = omit,
1214+
settle_animations: bool | Omit = omit,
12141215
shorten_base64_images: bool | Omit = omit,
12151216
stop_after_ms: int | Omit = omit,
12161217
timeout_ms: int | Omit = omit,
@@ -1266,6 +1267,10 @@ def web_crawl_md(
12661267
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
12671268
inclusive 1-based page range.
12681269
1270+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
1271+
extracting each crawled page. Defaults to false. This adds a bit of latency in
1272+
exchange for more stable output on animated pages.
1273+
12691274
shorten_base64_images: Truncate base64-encoded image data in the Markdown output
12701275
12711276
stop_after_ms: Soft time budget for the crawl in milliseconds. After each scrape, the crawler
@@ -1309,6 +1314,7 @@ def web_crawl_md(
13091314
"max_depth": max_depth,
13101315
"max_pages": max_pages,
13111316
"pdf": pdf,
1317+
"settle_animations": settle_animations,
13121318
"shorten_base64_images": shorten_base64_images,
13131319
"stop_after_ms": stop_after_ms,
13141320
"timeout_ms": timeout_ms,
@@ -1541,6 +1547,7 @@ def web_scrape_html(
15411547
include_selectors: SequenceNotStr[str] | Omit = omit,
15421548
max_age_ms: int | Omit = omit,
15431549
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
1550+
settle_animations: bool | Omit = omit,
15441551
timeout_ms: int | Omit = omit,
15451552
use_main_content_only: bool | Omit = omit,
15461553
wait_for_ms: int | Omit = omit,
@@ -1581,6 +1588,10 @@ def web_scrape_html(
15811588
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
15821589
inclusive 1-based page range.
15831590
1591+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
1592+
extracting HTML. Defaults to false. This adds a bit of latency in exchange for
1593+
more stable output on animated pages.
1594+
15841595
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
15851596
than this value, it will be aborted with a 408 status code. Maximum allowed
15861597
value is 300000ms (5 minutes).
@@ -1617,6 +1628,7 @@ def web_scrape_html(
16171628
"include_selectors": include_selectors,
16181629
"max_age_ms": max_age_ms,
16191630
"pdf": pdf,
1631+
"settle_animations": settle_animations,
16201632
"timeout_ms": timeout_ms,
16211633
"use_main_content_only": use_main_content_only,
16221634
"wait_for_ms": wait_for_ms,
@@ -1918,6 +1930,7 @@ def web_scrape_md(
19181930
include_selectors: SequenceNotStr[str] | Omit = omit,
19191931
max_age_ms: int | Omit = omit,
19201932
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
1933+
settle_animations: bool | Omit = omit,
19211934
shorten_base64_images: bool | Omit = omit,
19221935
timeout_ms: int | Omit = omit,
19231936
use_main_content_only: bool | Omit = omit,
@@ -1964,6 +1977,10 @@ def web_scrape_md(
19641977
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
19651978
inclusive 1-based page range.
19661979
1980+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
1981+
converting to Markdown. Defaults to false. This adds a bit of latency in
1982+
exchange for more stable output on animated pages.
1983+
19671984
shorten_base64_images: Shorten base64-encoded image data in the Markdown output
19681985
19691986
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
@@ -2003,6 +2020,7 @@ def web_scrape_md(
20032020
"include_selectors": include_selectors,
20042021
"max_age_ms": max_age_ms,
20052022
"pdf": pdf,
2023+
"settle_animations": settle_animations,
20062024
"shorten_base64_images": shorten_base64_images,
20072025
"timeout_ms": timeout_ms,
20082026
"use_main_content_only": use_main_content_only,
@@ -3244,6 +3262,7 @@ async def web_crawl_md(
32443262
max_depth: int | Omit = omit,
32453263
max_pages: int | Omit = omit,
32463264
pdf: web_web_crawl_md_params.Pdf | Omit = omit,
3265+
settle_animations: bool | Omit = omit,
32473266
shorten_base64_images: bool | Omit = omit,
32483267
stop_after_ms: int | Omit = omit,
32493268
timeout_ms: int | Omit = omit,
@@ -3299,6 +3318,10 @@ async def web_crawl_md(
32993318
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
33003319
inclusive 1-based page range.
33013320
3321+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
3322+
extracting each crawled page. Defaults to false. This adds a bit of latency in
3323+
exchange for more stable output on animated pages.
3324+
33023325
shorten_base64_images: Truncate base64-encoded image data in the Markdown output
33033326
33043327
stop_after_ms: Soft time budget for the crawl in milliseconds. After each scrape, the crawler
@@ -3342,6 +3365,7 @@ async def web_crawl_md(
33423365
"max_depth": max_depth,
33433366
"max_pages": max_pages,
33443367
"pdf": pdf,
3368+
"settle_animations": settle_animations,
33453369
"shorten_base64_images": shorten_base64_images,
33463370
"stop_after_ms": stop_after_ms,
33473371
"timeout_ms": timeout_ms,
@@ -3574,6 +3598,7 @@ async def web_scrape_html(
35743598
include_selectors: SequenceNotStr[str] | Omit = omit,
35753599
max_age_ms: int | Omit = omit,
35763600
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
3601+
settle_animations: bool | Omit = omit,
35773602
timeout_ms: int | Omit = omit,
35783603
use_main_content_only: bool | Omit = omit,
35793604
wait_for_ms: int | Omit = omit,
@@ -3614,6 +3639,10 @@ async def web_scrape_html(
36143639
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
36153640
inclusive 1-based page range.
36163641
3642+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
3643+
extracting HTML. Defaults to false. This adds a bit of latency in exchange for
3644+
more stable output on animated pages.
3645+
36173646
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
36183647
than this value, it will be aborted with a 408 status code. Maximum allowed
36193648
value is 300000ms (5 minutes).
@@ -3650,6 +3679,7 @@ async def web_scrape_html(
36503679
"include_selectors": include_selectors,
36513680
"max_age_ms": max_age_ms,
36523681
"pdf": pdf,
3682+
"settle_animations": settle_animations,
36533683
"timeout_ms": timeout_ms,
36543684
"use_main_content_only": use_main_content_only,
36553685
"wait_for_ms": wait_for_ms,
@@ -3951,6 +3981,7 @@ async def web_scrape_md(
39513981
include_selectors: SequenceNotStr[str] | Omit = omit,
39523982
max_age_ms: int | Omit = omit,
39533983
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
3984+
settle_animations: bool | Omit = omit,
39543985
shorten_base64_images: bool | Omit = omit,
39553986
timeout_ms: int | Omit = omit,
39563987
use_main_content_only: bool | Omit = omit,
@@ -3997,6 +4028,10 @@ async def web_scrape_md(
39974028
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
39984029
inclusive 1-based page range.
39994030
4031+
settle_animations: When true, waits briefly for CSS and transition animations to settle before
4032+
converting to Markdown. Defaults to false. This adds a bit of latency in
4033+
exchange for more stable output on animated pages.
4034+
40004035
shorten_base64_images: Shorten base64-encoded image data in the Markdown output
40014036
40024037
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
@@ -4036,6 +4071,7 @@ async def web_scrape_md(
40364071
"include_selectors": include_selectors,
40374072
"max_age_ms": max_age_ms,
40384073
"pdf": pdf,
4074+
"settle_animations": settle_animations,
40394075
"shorten_base64_images": shorten_base64_images,
40404076
"timeout_ms": timeout_ms,
40414077
"use_main_content_only": use_main_content_only,

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ class WebWebCrawlMdParams(TypedDict, total=False):
280280
range.
281281
"""
282282

283+
settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")]
284+
"""
285+
When true, waits briefly for CSS and transition animations to settle before
286+
extracting each crawled page. Defaults to false. This adds a bit of latency in
287+
exchange for more stable output on animated pages.
288+
"""
289+
283290
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
284291
"""Truncate base64-encoded image data in the Markdown output"""
285292

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
265265
range.
266266
"""
267267

268+
settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")]
269+
"""
270+
When true, waits briefly for CSS and transition animations to settle before
271+
extracting HTML. Defaults to false. This adds a bit of latency in exchange for
272+
more stable output on animated pages.
273+
"""
274+
268275
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
269276
"""Optional timeout in milliseconds for the request.
270277

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ class WebWebScrapeMdParams(TypedDict, total=False):
274274
range.
275275
"""
276276

277+
settle_animations: Annotated[bool, PropertyInfo(alias="settleAnimations")]
278+
"""
279+
When true, waits briefly for CSS and transition animations to settle before
280+
converting to Markdown. Defaults to false. This adds a bit of latency in
281+
exchange for more stable output on animated pages.
282+
"""
283+
277284
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
278285
"""Shorten base64-encoded image data in the Markdown output"""
279286

‎tests/api_resources/test_web.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ def test_method_web_crawl_md_with_all_params(self, client: ContextDev) -> None:
376376
"should_parse": True,
377377
"start": 1,
378378
},
379+
settle_animations=True,
379380
shorten_base64_images=True,
380381
stop_after_ms=10000,
381382
timeout_ms=1000,
@@ -435,6 +436,7 @@ def test_method_web_scrape_html_with_all_params(self, client: ContextDev) -> Non
435436
"should_parse": True,
436437
"start": 1,
437438
},
439+
settle_animations=True,
438440
timeout_ms=1000,
439441
use_main_content_only=True,
440442
wait_for_ms=0,
@@ -545,6 +547,7 @@ def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None:
545547
"should_parse": True,
546548
"start": 1,
547549
},
550+
settle_animations=True,
548551
shorten_base64_images=True,
549552
timeout_ms=1000,
550553
use_main_content_only=True,
@@ -977,6 +980,7 @@ async def test_method_web_crawl_md_with_all_params(self, async_client: AsyncCont
977980
"should_parse": True,
978981
"start": 1,
979982
},
983+
settle_animations=True,
980984
shorten_base64_images=True,
981985
stop_after_ms=10000,
982986
timeout_ms=1000,
@@ -1036,6 +1040,7 @@ async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncC
10361040
"should_parse": True,
10371041
"start": 1,
10381042
},
1043+
settle_animations=True,
10391044
timeout_ms=1000,
10401045
use_main_content_only=True,
10411046
wait_for_ms=0,
@@ -1146,6 +1151,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncCon
11461151
"should_parse": True,
11471152
"start": 1,
11481153
},
1154+
settle_animations=True,
11491155
shorten_base64_images=True,
11501156
timeout_ms=1000,
11511157
use_main_content_only=True,

0 commit comments

Comments
 (0)