Skip to content

Commit 4fea286

Browse files
feat(api): api update
1 parent d23341d commit 4fea286

6 files changed

Lines changed: 46 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: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-449cbc8437530f305b8e3ed49465d5faf720505a77f539bc8078162139fbbb69.yml
3-
openapi_spec_hash: 8e1dd204746bcfaaf637d93b1d339eb2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-3ab7c195646f05374a224a980cab48a6c9844ba7aedf9dba28c7fd8273b173f2.yml
3+
openapi_spec_hash: b10ee8536928665190a110738964fccb
44
config_hash: ff13935d1231ad44cd3822ffe39904b4

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def web_crawl_md(
249249
*,
250250
url: str,
251251
follow_subdomains: bool | Omit = omit,
252+
include_frames: bool | Omit = omit,
252253
include_images: bool | Omit = omit,
253254
include_links: bool | Omit = omit,
254255
max_age_ms: int | Omit = omit,
@@ -276,6 +277,9 @@ def web_crawl_md(
276277
docs.example.com when starting from example.com). www and apex are always
277278
treated as equivalent.
278279
280+
include_frames: When true, the contents of iframes are rendered to Markdown for each crawled
281+
page.
282+
279283
include_images: Include image references in the Markdown output
280284
281285
include_links: Preserve hyperlinks in the Markdown output
@@ -313,6 +317,7 @@ def web_crawl_md(
313317
{
314318
"url": url,
315319
"follow_subdomains": follow_subdomains,
320+
"include_frames": include_frames,
316321
"include_images": include_images,
317322
"include_links": include_links,
318323
"max_age_ms": max_age_ms,
@@ -335,6 +340,7 @@ def web_scrape_html(
335340
self,
336341
*,
337342
url: str,
343+
include_frames: bool | Omit = omit,
338344
max_age_ms: int | Omit = omit,
339345
parse_pdf: bool | Omit = omit,
340346
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -350,6 +356,8 @@ def web_scrape_html(
350356
Args:
351357
url: Full URL to scrape (must include http:// or https:// protocol)
352358
359+
include_frames: When true, iframes are rendered inline into the returned HTML.
360+
353361
max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
354362
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
355363
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
@@ -376,6 +384,7 @@ def web_scrape_html(
376384
query=maybe_transform(
377385
{
378386
"url": url,
387+
"include_frames": include_frames,
379388
"max_age_ms": max_age_ms,
380389
"parse_pdf": parse_pdf,
381390
},
@@ -429,6 +438,7 @@ def web_scrape_md(
429438
self,
430439
*,
431440
url: str,
441+
include_frames: bool | Omit = omit,
432442
include_images: bool | Omit = omit,
433443
include_links: bool | Omit = omit,
434444
max_age_ms: int | Omit = omit,
@@ -449,6 +459,8 @@ def web_scrape_md(
449459
url: Full URL to scrape into LLM usable Markdown (must include http:// or https://
450460
protocol)
451461
462+
include_frames: When true, the contents of iframes are rendered to Markdown.
463+
452464
include_images: Include image references in Markdown output
453465
454466
include_links: Preserve hyperlinks in Markdown output
@@ -484,6 +496,7 @@ def web_scrape_md(
484496
query=maybe_transform(
485497
{
486498
"url": url,
499+
"include_frames": include_frames,
487500
"include_images": include_images,
488501
"include_links": include_links,
489502
"max_age_ms": max_age_ms,
@@ -760,6 +773,7 @@ async def web_crawl_md(
760773
*,
761774
url: str,
762775
follow_subdomains: bool | Omit = omit,
776+
include_frames: bool | Omit = omit,
763777
include_images: bool | Omit = omit,
764778
include_links: bool | Omit = omit,
765779
max_age_ms: int | Omit = omit,
@@ -787,6 +801,9 @@ async def web_crawl_md(
787801
docs.example.com when starting from example.com). www and apex are always
788802
treated as equivalent.
789803
804+
include_frames: When true, the contents of iframes are rendered to Markdown for each crawled
805+
page.
806+
790807
include_images: Include image references in the Markdown output
791808
792809
include_links: Preserve hyperlinks in the Markdown output
@@ -824,6 +841,7 @@ async def web_crawl_md(
824841
{
825842
"url": url,
826843
"follow_subdomains": follow_subdomains,
844+
"include_frames": include_frames,
827845
"include_images": include_images,
828846
"include_links": include_links,
829847
"max_age_ms": max_age_ms,
@@ -846,6 +864,7 @@ async def web_scrape_html(
846864
self,
847865
*,
848866
url: str,
867+
include_frames: bool | Omit = omit,
849868
max_age_ms: int | Omit = omit,
850869
parse_pdf: bool | Omit = omit,
851870
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -861,6 +880,8 @@ async def web_scrape_html(
861880
Args:
862881
url: Full URL to scrape (must include http:// or https:// protocol)
863882
883+
include_frames: When true, iframes are rendered inline into the returned HTML.
884+
864885
max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
865886
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
866887
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
@@ -887,6 +908,7 @@ async def web_scrape_html(
887908
query=await async_maybe_transform(
888909
{
889910
"url": url,
911+
"include_frames": include_frames,
890912
"max_age_ms": max_age_ms,
891913
"parse_pdf": parse_pdf,
892914
},
@@ -940,6 +962,7 @@ async def web_scrape_md(
940962
self,
941963
*,
942964
url: str,
965+
include_frames: bool | Omit = omit,
943966
include_images: bool | Omit = omit,
944967
include_links: bool | Omit = omit,
945968
max_age_ms: int | Omit = omit,
@@ -960,6 +983,8 @@ async def web_scrape_md(
960983
url: Full URL to scrape into LLM usable Markdown (must include http:// or https://
961984
protocol)
962985
986+
include_frames: When true, the contents of iframes are rendered to Markdown.
987+
963988
include_images: Include image references in Markdown output
964989
965990
include_links: Preserve hyperlinks in Markdown output
@@ -995,6 +1020,7 @@ async def web_scrape_md(
9951020
query=await async_maybe_transform(
9961021
{
9971022
"url": url,
1023+
"include_frames": include_frames,
9981024
"include_images": include_images,
9991025
"include_links": include_links,
10001026
"max_age_ms": max_age_ms,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class WebWebCrawlMdParams(TypedDict, total=False):
2020
treated as equivalent.
2121
"""
2222

23+
include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")]
24+
"""
25+
When true, the contents of iframes are rendered to Markdown for each crawled
26+
page.
27+
"""
28+
2329
include_images: Annotated[bool, PropertyInfo(alias="includeImages")]
2430
"""Include image references in the Markdown output"""
2531

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
1313
url: Required[str]
1414
"""Full URL to scrape (must include http:// or https:// protocol)"""
1515

16+
include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")]
17+
"""When true, iframes are rendered inline into the returned HTML."""
18+
1619
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
1720
"""
1821
Return a cached result if a prior scrape for the same parameters exists and is

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class WebWebScrapeMdParams(TypedDict, total=False):
1616
protocol)
1717
"""
1818

19+
include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")]
20+
"""When true, the contents of iframes are rendered to Markdown."""
21+
1922
include_images: Annotated[bool, PropertyInfo(alias="includeImages")]
2023
"""Include image references in Markdown output"""
2124

‎tests/api_resources/test_web.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def test_method_web_crawl_md_with_all_params(self, client: ContextDev) -> None:
156156
web = client.web.web_crawl_md(
157157
url="https://example.com",
158158
follow_subdomains=True,
159+
include_frames=True,
159160
include_images=True,
160161
include_links=True,
161162
max_age_ms=0,
@@ -207,6 +208,7 @@ def test_method_web_scrape_html(self, client: ContextDev) -> None:
207208
def test_method_web_scrape_html_with_all_params(self, client: ContextDev) -> None:
208209
web = client.web.web_scrape_html(
209210
url="https://example.com",
211+
include_frames=True,
210212
max_age_ms=0,
211213
parse_pdf=True,
212214
)
@@ -285,6 +287,7 @@ def test_method_web_scrape_md(self, client: ContextDev) -> None:
285287
def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None:
286288
web = client.web.web_scrape_md(
287289
url="https://example.com",
290+
include_frames=True,
288291
include_images=True,
289292
include_links=True,
290293
max_age_ms=0,
@@ -500,6 +503,7 @@ async def test_method_web_crawl_md_with_all_params(self, async_client: AsyncCont
500503
web = await async_client.web.web_crawl_md(
501504
url="https://example.com",
502505
follow_subdomains=True,
506+
include_frames=True,
503507
include_images=True,
504508
include_links=True,
505509
max_age_ms=0,
@@ -551,6 +555,7 @@ async def test_method_web_scrape_html(self, async_client: AsyncContextDev) -> No
551555
async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncContextDev) -> None:
552556
web = await async_client.web.web_scrape_html(
553557
url="https://example.com",
558+
include_frames=True,
554559
max_age_ms=0,
555560
parse_pdf=True,
556561
)
@@ -629,6 +634,7 @@ async def test_method_web_scrape_md(self, async_client: AsyncContextDev) -> None
629634
async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncContextDev) -> None:
630635
web = await async_client.web.web_scrape_md(
631636
url="https://example.com",
637+
include_frames=True,
632638
include_images=True,
633639
include_links=True,
634640
max_age_ms=0,

0 commit comments

Comments
 (0)