Skip to content

Commit f502ad6

Browse files
feat(api): api update
1 parent 6f40553 commit f502ad6

4 files changed

Lines changed: 20 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: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-753a0c8375b4f2888cf6563c26df3dfa6a10e3ea29de83cd7736a20ec7295d28.yml
3-
openapi_spec_hash: d95fef5f0fbc5a22c3362ae822b814a4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml
3+
openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14
44
config_hash: 38268bb88fc4dcbb8f2f94dd138b5910

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def web_scrape_md(
203203
include_images: bool | Omit = omit,
204204
include_links: bool | Omit = omit,
205205
shorten_base64_images: bool | Omit = omit,
206+
use_main_content_only: bool | Omit = omit,
206207
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
207208
# The extra values given here take precedence over values defined on the client or passed to this method.
208209
extra_headers: Headers | None = None,
@@ -224,6 +225,9 @@ def web_scrape_md(
224225
225226
shorten_base64_images: Shorten base64-encoded image data in the Markdown output
226227
228+
use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
229+
and navigation
230+
227231
extra_headers: Send extra headers
228232
229233
extra_query: Add additional query parameters to the request
@@ -245,6 +249,7 @@ def web_scrape_md(
245249
"include_images": include_images,
246250
"include_links": include_links,
247251
"shorten_base64_images": shorten_base64_images,
252+
"use_main_content_only": use_main_content_only,
248253
},
249254
web_web_scrape_md_params.WebWebScrapeMdParams,
250255
),
@@ -473,6 +478,7 @@ async def web_scrape_md(
473478
include_images: bool | Omit = omit,
474479
include_links: bool | Omit = omit,
475480
shorten_base64_images: bool | Omit = omit,
481+
use_main_content_only: bool | Omit = omit,
476482
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
477483
# The extra values given here take precedence over values defined on the client or passed to this method.
478484
extra_headers: Headers | None = None,
@@ -494,6 +500,9 @@ async def web_scrape_md(
494500
495501
shorten_base64_images: Shorten base64-encoded image data in the Markdown output
496502
503+
use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars,
504+
and navigation
505+
497506
extra_headers: Send extra headers
498507
499508
extra_query: Add additional query parameters to the request
@@ -515,6 +524,7 @@ async def web_scrape_md(
515524
"include_images": include_images,
516525
"include_links": include_links,
517526
"shorten_base64_images": shorten_base64_images,
527+
"use_main_content_only": use_main_content_only,
518528
},
519529
web_web_scrape_md_params.WebWebScrapeMdParams,
520530
),

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ class WebWebScrapeMdParams(TypedDict, total=False):
2424

2525
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
2626
"""Shorten base64-encoded image data in the Markdown output"""
27+
28+
use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")]
29+
"""
30+
Extract only the main content of the page, excluding headers, footers, sidebars,
31+
and navigation
32+
"""

‎tests/api_resources/test_web.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None:
152152
include_images=True,
153153
include_links=True,
154154
shorten_base64_images=True,
155+
use_main_content_only=True,
155156
)
156157
assert_matches_type(WebWebScrapeMdResponse, web, path=["response"])
157158

@@ -359,6 +360,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncCon
359360
include_images=True,
360361
include_links=True,
361362
shorten_base64_images=True,
363+
use_main_content_only=True,
362364
)
363365
assert_matches_type(WebWebScrapeMdResponse, web, path=["response"])
364366

0 commit comments

Comments
 (0)