Skip to content

Commit a954487

Browse files
author
stlc-bot
committed
feat(scrape): default cache age to three days and allow one year (#1339)
Stainless-Generated-From: 693ff37
1 parent f5ec408 commit a954487

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def scrape(
380380
markdown_params: Markdown options. Requires `formats.markdown`.
381381
382382
max_age_ms: Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to
383-
1 day.
383+
3 days (259200000 ms). Maximum: 1 year (31536000000 ms).
384384
385385
parse_params: Required when formats.parse is true.
386386
@@ -1778,7 +1778,7 @@ async def scrape(
17781778
markdown_params: Markdown options. Requires `formats.markdown`.
17791779
17801780
max_age_ms: Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to
1781-
1 day.
1781+
3 days (259200000 ms). Maximum: 1 year (31536000000 ms).
17821782
17831783
parse_params: Required when formats.parse is true.
17841784

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,11 @@ class InputScrapeDataMarkdownOptions(TypedDict, total=False):
346346
"""
347347

348348
max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")]
349-
"""Maximum cache age in milliseconds. Defaults to 1 day. `0` fetches fresh."""
349+
"""Maximum cache age in milliseconds.
350+
351+
Defaults to 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). `0` fetches
352+
fresh.
353+
"""
350354

351355
pdf: InputScrapeDataMarkdownOptionsPdf
352356
"""PDF parsing controls.
@@ -647,7 +651,11 @@ class InputScrapeDataHTMLOptions(TypedDict, total=False):
647651
"""
648652

649653
max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")]
650-
"""Maximum cache age in milliseconds. Defaults to 1 day. `0` fetches fresh."""
654+
"""Maximum cache age in milliseconds.
655+
656+
Defaults to 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). `0` fetches
657+
fresh.
658+
"""
651659

652660
pdf: InputScrapeDataHTMLOptionsPdf
653661
"""PDF parsing controls.
@@ -1021,7 +1029,11 @@ class InputCrawlDataMarkdownOptions(TypedDict, total=False):
10211029
"""
10221030

10231031
max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")]
1024-
"""Maximum cache age in milliseconds. Defaults to 1 day. `0` fetches fresh."""
1032+
"""Maximum cache age in milliseconds.
1033+
1034+
Defaults to 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). `0` fetches
1035+
fresh.
1036+
"""
10251037

10261038
pdf: InputCrawlDataMarkdownOptionsPdf
10271039
"""PDF parsing controls.
@@ -1374,7 +1386,11 @@ class InputCrawlDataHTMLOptions(TypedDict, total=False):
13741386
"""
13751387

13761388
max_age_ms: Annotated[Optional[int], PropertyInfo(alias="maxAgeMs")]
1377-
"""Maximum cache age in milliseconds. Defaults to 1 day. `0` fetches fresh."""
1389+
"""Maximum cache age in milliseconds.
1390+
1391+
Defaults to 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). `0` fetches
1392+
fresh.
1393+
"""
13781394

13791395
pdf: InputCrawlDataHTMLOptionsPdf
13801396
"""PDF parsing controls.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class WebScrapeParams(TypedDict, total=False):
5858
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
5959
"""Maximum age of a cached output, in milliseconds.
6060
61-
`0` fetches fresh. Defaults to 1 day.
61+
`0` fetches fresh. Defaults to 3 days (259200000 ms). Maximum: 1 year
62+
(31536000000 ms).
6263
"""
6364

6465
parse_params: Annotated[ParseParams, PropertyInfo(alias="parseParams")]

0 commit comments

Comments
 (0)