Skip to content

Commit 4bbf3b1

Browse files
feat(api): api update
1 parent 41ee2e8 commit 4bbf3b1

4 files changed

Lines changed: 26 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-171b4c39eb26210aad8afd74d63d620bf45f7e0b7f2de3938c7239741ea3f2f4.yml
3-
openapi_spec_hash: 752c05fc817dc766061bd4357bd327ba
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-633097a61ae4e029434e5af07efa3017301fe8b391c27ada3eb68b61d798ef33.yml
3+
openapi_spec_hash: 051b08a4c6530546d520aa7ec18f8123
44
config_hash: 7ec4851ee8d93177947e95df5ae897b5

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ def web_scrape_images(
16431643
self,
16441644
*,
16451645
url: str,
1646+
dedupe: bool | Omit = omit,
16461647
enrichment: web_web_scrape_images_params.Enrichment | Omit = omit,
16471648
headers: Dict[str, str] | Omit = omit,
16481649
max_age_ms: int | Omit = omit,
@@ -1664,6 +1665,11 @@ def web_scrape_images(
16641665
Args:
16651666
url: Page URL to inspect. Must include http:// or https://.
16661667
1668+
dedupe: When true, visually duplicate images are removed: every image is loaded and
1669+
perceptually hashed, and only the highest-resolution copy of each duplicate
1670+
group is kept. Images that cannot be downloaded or hashed are kept. Default:
1671+
false.
1672+
16671673
enrichment: Optional per-image processing, sent as deep-object query params such as
16681674
enrichment[resolution]=true.
16691675
@@ -1699,6 +1705,7 @@ def web_scrape_images(
16991705
query=maybe_transform(
17001706
{
17011707
"url": url,
1708+
"dedupe": dedupe,
17021709
"enrichment": enrichment,
17031710
"headers": headers,
17041711
"max_age_ms": max_age_ms,
@@ -3694,6 +3701,7 @@ async def web_scrape_images(
36943701
self,
36953702
*,
36963703
url: str,
3704+
dedupe: bool | Omit = omit,
36973705
enrichment: web_web_scrape_images_params.Enrichment | Omit = omit,
36983706
headers: Dict[str, str] | Omit = omit,
36993707
max_age_ms: int | Omit = omit,
@@ -3715,6 +3723,11 @@ async def web_scrape_images(
37153723
Args:
37163724
url: Page URL to inspect. Must include http:// or https://.
37173725
3726+
dedupe: When true, visually duplicate images are removed: every image is loaded and
3727+
perceptually hashed, and only the highest-resolution copy of each duplicate
3728+
group is kept. Images that cannot be downloaded or hashed are kept. Default:
3729+
false.
3730+
37183731
enrichment: Optional per-image processing, sent as deep-object query params such as
37193732
enrichment[resolution]=true.
37203733
@@ -3750,6 +3763,7 @@ async def web_scrape_images(
37503763
query=await async_maybe_transform(
37513764
{
37523765
"url": url,
3766+
"dedupe": dedupe,
37533767
"enrichment": enrichment,
37543768
"headers": headers,
37553769
"max_age_ms": max_age_ms,

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ class WebWebScrapeImagesParams(TypedDict, total=False):
1414
url: Required[str]
1515
"""Page URL to inspect. Must include http:// or https://."""
1616

17+
dedupe: bool
18+
"""
19+
When true, visually duplicate images are removed: every image is loaded and
20+
perceptually hashed, and only the highest-resolution copy of each duplicate
21+
group is kept. Images that cannot be downloaded or hashed are kept. Default:
22+
false.
23+
"""
24+
1725
enrichment: Enrichment
1826
"""
1927
Optional per-image processing, sent as deep-object query params such as

‎tests/api_resources/test_web.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ def test_method_web_scrape_images(self, client: ContextDev) -> None:
482482
def test_method_web_scrape_images_with_all_params(self, client: ContextDev) -> None:
483483
web = client.web.web_scrape_images(
484484
url="https://example.com",
485+
dedupe=True,
485486
enrichment={
486487
"classification": True,
487488
"hosted_url": True,
@@ -1086,6 +1087,7 @@ async def test_method_web_scrape_images(self, async_client: AsyncContextDev) ->
10861087
async def test_method_web_scrape_images_with_all_params(self, async_client: AsyncContextDev) -> None:
10871088
web = await async_client.web.web_scrape_images(
10881089
url="https://example.com",
1090+
dedupe=True,
10891091
enrichment={
10901092
"classification": True,
10911093
"hosted_url": True,

0 commit comments

Comments
 (0)