Skip to content

Commit 4ae29fb

Browse files
feat(api): api update
1 parent 08d9b02 commit 4ae29fb

12 files changed

Lines changed: 151 additions & 4 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8cd70a2b5bd380b75e5f94dc376bd8c704ee0431bdfe8af1b017facc2b883097.yml
3-
openapi_spec_hash: bb1d32ae5c46be85ee8bb3b13f5b1150
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-42c531dcf60b5d35e3996c1a669a3fe2de19d8caedf2bfd69e4864a1041c9bfa.yml
3+
openapi_spec_hash: e43dd84c75e6d710c7346b9f12c34738
44
config_hash: daabb160675d86b354711da1e77e5129

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def handle(
143143
shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit,
144144
tags: SequenceNotStr[str] | Omit = omit,
145145
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
146+
zdr: Literal["enabled", "disabled"] | Omit = omit,
146147
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147148
# The extra values given here take precedence over values defined on the client or passed to this method.
148149
extra_headers: Headers | None = None,
@@ -179,6 +180,11 @@ def handle(
179180
180181
use_main_content_only: Extract only the main content from HTML-like inputs
181182
183+
zdr: Set to enabled to bypass shared caches and omit request and response content
184+
from retained usage logs. Requires zero data retention to be enabled for your
185+
organization (contact support@context.dev), otherwise the request fails with
186+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
187+
182188
extra_headers: Send extra headers
183189
184190
extra_query: Add additional query parameters to the request
@@ -207,6 +213,7 @@ def handle(
207213
"shorten_base64_images": shorten_base64_images,
208214
"tags": tags,
209215
"use_main_content_only": use_main_content_only,
216+
"zdr": zdr,
210217
},
211218
parse_handle_params.ParseHandleParams,
212219
),
@@ -320,6 +327,7 @@ async def handle(
320327
shorten_base64_images: Union[bool, Literal["true", "false"]] | Omit = omit,
321328
tags: SequenceNotStr[str] | Omit = omit,
322329
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
330+
zdr: Literal["enabled", "disabled"] | Omit = omit,
323331
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
324332
# The extra values given here take precedence over values defined on the client or passed to this method.
325333
extra_headers: Headers | None = None,
@@ -356,6 +364,11 @@ async def handle(
356364
357365
use_main_content_only: Extract only the main content from HTML-like inputs
358366
367+
zdr: Set to enabled to bypass shared caches and omit request and response content
368+
from retained usage logs. Requires zero data retention to be enabled for your
369+
organization (contact support@context.dev), otherwise the request fails with
370+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
371+
359372
extra_headers: Send extra headers
360373
361374
extra_query: Add additional query parameters to the request
@@ -384,6 +397,7 @@ async def handle(
384397
"shorten_base64_images": shorten_base64_images,
385398
"tags": tags,
386399
"use_main_content_only": use_main_content_only,
400+
"zdr": zdr,
387401
},
388402
parse_handle_params.ParseHandleParams,
389403
),

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

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ def screenshot(
605605
timeout_ms: int | Omit = omit,
606606
viewport: web_screenshot_params.Viewport | Omit = omit,
607607
wait_for_ms: Optional[int] | Omit = omit,
608+
zdr: Literal["enabled", "disabled"] | Omit = omit,
608609
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
609610
# The extra values given here take precedence over values defined on the client or passed to this method.
610611
extra_headers: Headers | None = None,
@@ -670,6 +671,11 @@ def screenshot(
670671
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
671672
omitted.
672673
674+
zdr: Set to enabled to bypass shared caches and omit request and response content
675+
from retained usage logs. Requires zero data retention to be enabled for your
676+
organization (contact support@context.dev), otherwise the request fails with
677+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
678+
673679
extra_headers: Send extra headers
674680
675681
extra_query: Add additional query parameters to the request
@@ -700,6 +706,7 @@ def screenshot(
700706
"timeout_ms": timeout_ms,
701707
"viewport": viewport,
702708
"wait_for_ms": wait_for_ms,
709+
"zdr": zdr,
703710
},
704711
web_screenshot_params.WebScreenshotParams,
705712
),
@@ -1258,6 +1265,7 @@ def web_crawl_md(
12581265
url_regex: str | Omit = omit,
12591266
use_main_content_only: bool | Omit = omit,
12601267
wait_for_ms: int | Omit = omit,
1268+
zdr: Literal["enabled", "disabled"] | Omit = omit,
12611269
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
12621270
# The extra values given here take precedence over values defined on the client or passed to this method.
12631271
extra_headers: Headers | None = None,
@@ -1332,6 +1340,11 @@ def web_crawl_md(
13321340
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
13331341
crawled page. Min: 0. Max: 30000 (30 seconds).
13341342
1343+
zdr: Set to enabled to bypass shared caches and omit request and response content
1344+
from retained usage logs. Requires zero data retention to be enabled for your
1345+
organization (contact support@context.dev), otherwise the request fails with
1346+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
1347+
13351348
extra_headers: Send extra headers
13361349
13371350
extra_query: Add additional query parameters to the request
@@ -1364,6 +1377,7 @@ def web_crawl_md(
13641377
"url_regex": url_regex,
13651378
"use_main_content_only": use_main_content_only,
13661379
"wait_for_ms": wait_for_ms,
1380+
"zdr": zdr,
13671381
},
13681382
web_web_crawl_md_params.WebWebCrawlMdParams,
13691383
),
@@ -1595,6 +1609,7 @@ def web_scrape_html(
15951609
timeout_ms: int | Omit = omit,
15961610
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
15971611
wait_for_ms: Optional[int] | Omit = omit,
1612+
zdr: Literal["enabled", "disabled"] | Omit = omit,
15981613
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
15991614
# The extra values given here take precedence over values defined on the client or passed to this method.
16001615
extra_headers: Headers | None = None,
@@ -1652,6 +1667,11 @@ def web_scrape_html(
16521667
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
16531668
30000 (30 seconds).
16541669
1670+
zdr: Set to enabled to bypass shared caches and omit request and response content
1671+
from retained usage logs. Requires zero data retention to be enabled for your
1672+
organization (contact support@context.dev), otherwise the request fails with
1673+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
1674+
16551675
extra_headers: Send extra headers
16561676
16571677
extra_query: Add additional query parameters to the request
@@ -1682,6 +1702,7 @@ def web_scrape_html(
16821702
"timeout_ms": timeout_ms,
16831703
"use_main_content_only": use_main_content_only,
16841704
"wait_for_ms": wait_for_ms,
1705+
"zdr": zdr,
16851706
},
16861707
web_web_scrape_html_params.WebWebScrapeHTMLParams,
16871708
),
@@ -1999,6 +2020,7 @@ def web_scrape_md(
19992020
timeout_ms: int | Omit = omit,
20002021
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
20012022
wait_for_ms: Optional[int] | Omit = omit,
2023+
zdr: Literal["enabled", "disabled"] | Omit = omit,
20022024
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
20032025
# The extra values given here take precedence over values defined on the client or passed to this method.
20042026
extra_headers: Headers | None = None,
@@ -2078,6 +2100,11 @@ def web_scrape_md(
20782100
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
20792101
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
20802102
2103+
zdr: Set to enabled to bypass shared caches and omit request and response content
2104+
from retained usage logs. Requires zero data retention to be enabled for your
2105+
organization (contact support@context.dev), otherwise the request fails with
2106+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
2107+
20812108
extra_headers: Send extra headers
20822109
20832110
extra_query: Add additional query parameters to the request
@@ -2111,6 +2138,7 @@ def web_scrape_md(
21112138
"timeout_ms": timeout_ms,
21122139
"use_main_content_only": use_main_content_only,
21132140
"wait_for_ms": wait_for_ms,
2141+
"zdr": zdr,
21142142
},
21152143
web_web_scrape_md_params.WebWebScrapeMdParams,
21162144
),
@@ -2128,6 +2156,7 @@ def web_scrape_sitemap(
21282156
tags: SequenceNotStr[str] | Omit = omit,
21292157
timeout_ms: int | Omit = omit,
21302158
url_regex: str | Omit = omit,
2159+
zdr: Literal["enabled", "disabled"] | Omit = omit,
21312160
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
21322161
# The extra values given here take precedence over values defined on the client or passed to this method.
21332162
extra_headers: Headers | None = None,
@@ -2162,6 +2191,11 @@ def web_scrape_sitemap(
21622191
url_regex: Optional RE2-compatible regex pattern. Only URLs matching this pattern are
21632192
returned and counted against maxLinks.
21642193
2194+
zdr: Set to enabled to bypass shared caches and omit request and response content
2195+
from retained usage logs. Requires zero data retention to be enabled for your
2196+
organization (contact support@context.dev), otherwise the request fails with
2197+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
2198+
21652199
extra_headers: Send extra headers
21662200
21672201
extra_query: Add additional query parameters to the request
@@ -2186,6 +2220,7 @@ def web_scrape_sitemap(
21862220
"tags": tags,
21872221
"timeout_ms": timeout_ms,
21882222
"url_regex": url_regex,
2223+
"zdr": zdr,
21892224
},
21902225
web_web_scrape_sitemap_params.WebWebScrapeSitemapParams,
21912226
),
@@ -2753,6 +2788,7 @@ async def screenshot(
27532788
timeout_ms: int | Omit = omit,
27542789
viewport: web_screenshot_params.Viewport | Omit = omit,
27552790
wait_for_ms: Optional[int] | Omit = omit,
2791+
zdr: Literal["enabled", "disabled"] | Omit = omit,
27562792
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
27572793
# The extra values given here take precedence over values defined on the client or passed to this method.
27582794
extra_headers: Headers | None = None,
@@ -2818,6 +2854,11 @@ async def screenshot(
28182854
the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
28192855
omitted.
28202856
2857+
zdr: Set to enabled to bypass shared caches and omit request and response content
2858+
from retained usage logs. Requires zero data retention to be enabled for your
2859+
organization (contact support@context.dev), otherwise the request fails with
2860+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
2861+
28212862
extra_headers: Send extra headers
28222863
28232864
extra_query: Add additional query parameters to the request
@@ -2848,6 +2889,7 @@ async def screenshot(
28482889
"timeout_ms": timeout_ms,
28492890
"viewport": viewport,
28502891
"wait_for_ms": wait_for_ms,
2892+
"zdr": zdr,
28512893
},
28522894
web_screenshot_params.WebScreenshotParams,
28532895
),
@@ -3406,6 +3448,7 @@ async def web_crawl_md(
34063448
url_regex: str | Omit = omit,
34073449
use_main_content_only: bool | Omit = omit,
34083450
wait_for_ms: int | Omit = omit,
3451+
zdr: Literal["enabled", "disabled"] | Omit = omit,
34093452
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
34103453
# The extra values given here take precedence over values defined on the client or passed to this method.
34113454
extra_headers: Headers | None = None,
@@ -3480,6 +3523,11 @@ async def web_crawl_md(
34803523
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
34813524
crawled page. Min: 0. Max: 30000 (30 seconds).
34823525
3526+
zdr: Set to enabled to bypass shared caches and omit request and response content
3527+
from retained usage logs. Requires zero data retention to be enabled for your
3528+
organization (contact support@context.dev), otherwise the request fails with
3529+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
3530+
34833531
extra_headers: Send extra headers
34843532
34853533
extra_query: Add additional query parameters to the request
@@ -3512,6 +3560,7 @@ async def web_crawl_md(
35123560
"url_regex": url_regex,
35133561
"use_main_content_only": use_main_content_only,
35143562
"wait_for_ms": wait_for_ms,
3563+
"zdr": zdr,
35153564
},
35163565
web_web_crawl_md_params.WebWebCrawlMdParams,
35173566
),
@@ -3743,6 +3792,7 @@ async def web_scrape_html(
37433792
timeout_ms: int | Omit = omit,
37443793
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
37453794
wait_for_ms: Optional[int] | Omit = omit,
3795+
zdr: Literal["enabled", "disabled"] | Omit = omit,
37463796
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
37473797
# The extra values given here take precedence over values defined on the client or passed to this method.
37483798
extra_headers: Headers | None = None,
@@ -3800,6 +3850,11 @@ async def web_scrape_html(
38003850
Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
38013851
30000 (30 seconds).
38023852
3853+
zdr: Set to enabled to bypass shared caches and omit request and response content
3854+
from retained usage logs. Requires zero data retention to be enabled for your
3855+
organization (contact support@context.dev), otherwise the request fails with
3856+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
3857+
38033858
extra_headers: Send extra headers
38043859
38053860
extra_query: Add additional query parameters to the request
@@ -3830,6 +3885,7 @@ async def web_scrape_html(
38303885
"timeout_ms": timeout_ms,
38313886
"use_main_content_only": use_main_content_only,
38323887
"wait_for_ms": wait_for_ms,
3888+
"zdr": zdr,
38333889
},
38343890
web_web_scrape_html_params.WebWebScrapeHTMLParams,
38353891
),
@@ -4147,6 +4203,7 @@ async def web_scrape_md(
41474203
timeout_ms: int | Omit = omit,
41484204
use_main_content_only: Union[bool, Literal["true", "false"]] | Omit = omit,
41494205
wait_for_ms: Optional[int] | Omit = omit,
4206+
zdr: Literal["enabled", "disabled"] | Omit = omit,
41504207
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
41514208
# The extra values given here take precedence over values defined on the client or passed to this method.
41524209
extra_headers: Headers | None = None,
@@ -4226,6 +4283,11 @@ async def web_scrape_md(
42264283
wait_for_ms: Optional browser wait time in milliseconds after initial page load before
42274284
converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
42284285
4286+
zdr: Set to enabled to bypass shared caches and omit request and response content
4287+
from retained usage logs. Requires zero data retention to be enabled for your
4288+
organization (contact support@context.dev), otherwise the request fails with
4289+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
4290+
42294291
extra_headers: Send extra headers
42304292
42314293
extra_query: Add additional query parameters to the request
@@ -4259,6 +4321,7 @@ async def web_scrape_md(
42594321
"timeout_ms": timeout_ms,
42604322
"use_main_content_only": use_main_content_only,
42614323
"wait_for_ms": wait_for_ms,
4324+
"zdr": zdr,
42624325
},
42634326
web_web_scrape_md_params.WebWebScrapeMdParams,
42644327
),
@@ -4276,6 +4339,7 @@ async def web_scrape_sitemap(
42764339
tags: SequenceNotStr[str] | Omit = omit,
42774340
timeout_ms: int | Omit = omit,
42784341
url_regex: str | Omit = omit,
4342+
zdr: Literal["enabled", "disabled"] | Omit = omit,
42794343
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
42804344
# The extra values given here take precedence over values defined on the client or passed to this method.
42814345
extra_headers: Headers | None = None,
@@ -4310,6 +4374,11 @@ async def web_scrape_sitemap(
43104374
url_regex: Optional RE2-compatible regex pattern. Only URLs matching this pattern are
43114375
returned and counted against maxLinks.
43124376
4377+
zdr: Set to enabled to bypass shared caches and omit request and response content
4378+
from retained usage logs. Requires zero data retention to be enabled for your
4379+
organization (contact support@context.dev), otherwise the request fails with
4380+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
4381+
43134382
extra_headers: Send extra headers
43144383
43154384
extra_query: Add additional query parameters to the request
@@ -4334,6 +4403,7 @@ async def web_scrape_sitemap(
43344403
"tags": tags,
43354404
"timeout_ms": timeout_ms,
43364405
"url_regex": url_regex,
4406+
"zdr": zdr,
43374407
},
43384408
web_web_scrape_sitemap_params.WebWebScrapeSitemapParams,
43394409
),

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ class ParseHandleParams(TypedDict, total=False):
122122
use_main_content_only: Annotated[Union[bool, Literal["true", "false"]], PropertyInfo(alias="useMainContentOnly")]
123123
"""Extract only the main content from HTML-like inputs"""
124124

125+
zdr: Literal["enabled", "disabled"]
126+
"""
127+
Set to enabled to bypass shared caches and omit request and response content
128+
from retained usage logs. Requires zero data retention to be enabled for your
129+
organization (contact support@context.dev), otherwise the request fails with
130+
ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
131+
"""
132+
125133

126134
class Pdf(TypedDict, total=False):
127135
"""PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}."""

0 commit comments

Comments
 (0)