diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b8dda9b..554e34b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.29.0" + ".": "0.30.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7e84f7a..132441d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-30ba67603321f69c2ba0432320c45caa4727ebbe353bea8874c9e7db8b95b09e.yml -openapi_spec_hash: 7dc1fadcec32637e795f641a0e97c63e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-9575a58bf027da9ca006bf34d9e24850ef2bbc6de0459b9fff6f26cf62e1d82d.yml +openapi_spec_hash: e68a98dbc0e29b45c42b3517eb554e6c config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c diff --git a/CHANGELOG.md b/CHANGELOG.md index 488cc29..dac3c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.30.0 (2026-06-06) + +Full Changelog: [v0.29.0...v0.30.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.29.0...v0.30.0) + +### Features + +* **api:** api update ([2b2246d](https://github.com/context-dot-dev/context-python-sdk/commit/2b2246dfde12d977b938a90f4938014ef2695eb8)) + ## 0.29.0 (2026-06-01) Full Changelog: [v0.28.0...v0.29.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.28.0...v0.29.0) diff --git a/pyproject.toml b/pyproject.toml index f59cebb..eb5d463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.29.0" +version = "0.30.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 5bbc7f0..57667bf 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "0.29.0" # x-release-please-version +__version__ = "0.30.0" # x-release-please-version diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index 3fc6361..fc6c06d 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -612,6 +612,7 @@ def web_scrape_html( self, *, url: str, + headers: Dict[str, str] | Omit = omit, include_frames: bool | Omit = omit, max_age_ms: int | Omit = omit, pdf: web_web_scrape_html_params.Pdf | Omit = omit, @@ -630,6 +631,10 @@ def web_scrape_html( Args: url: Full URL to scrape (must include http:// or https:// protocol) + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + include_frames: When true, iframes are rendered inline into the returned HTML. max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is @@ -665,6 +670,7 @@ def web_scrape_html( query=maybe_transform( { "url": url, + "headers": headers, "include_frames": include_frames, "max_age_ms": max_age_ms, "pdf": pdf, @@ -682,6 +688,7 @@ def web_scrape_images( *, url: str, enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, + headers: Dict[str, str] | Omit = omit, max_age_ms: int | Omit = omit, timeout_ms: int | Omit = omit, wait_for_ms: int | Omit = omit, @@ -704,6 +711,10 @@ def web_scrape_images( enrichment: Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true. + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). @@ -733,6 +744,7 @@ def web_scrape_images( { "url": url, "enrichment": enrichment, + "headers": headers, "max_age_ms": max_age_ms, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, @@ -747,6 +759,7 @@ def web_scrape_md( self, *, url: str, + headers: Dict[str, str] | Omit = omit, include_frames: bool | Omit = omit, include_images: bool | Omit = omit, include_links: bool | Omit = omit, @@ -770,6 +783,10 @@ def web_scrape_md( url: Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol) + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + include_frames: When true, the contents of iframes are rendered to Markdown. include_images: Include image references in Markdown output @@ -813,6 +830,7 @@ def web_scrape_md( query=maybe_transform( { "url": url, + "headers": headers, "include_frames": include_frames, "include_images": include_images, "include_links": include_links, @@ -833,6 +851,7 @@ def web_scrape_sitemap( self, *, domain: str, + headers: Dict[str, str] | Omit = omit, max_links: int | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, @@ -849,6 +868,10 @@ def web_scrape_sitemap( Args: domain: Domain to build a sitemap for + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000. @@ -877,6 +900,7 @@ def web_scrape_sitemap( query=maybe_transform( { "domain": domain, + "headers": headers, "max_links": max_links, "timeout_ms": timeout_ms, "url_regex": url_regex, @@ -1454,6 +1478,7 @@ async def web_scrape_html( self, *, url: str, + headers: Dict[str, str] | Omit = omit, include_frames: bool | Omit = omit, max_age_ms: int | Omit = omit, pdf: web_web_scrape_html_params.Pdf | Omit = omit, @@ -1472,6 +1497,10 @@ async def web_scrape_html( Args: url: Full URL to scrape (must include http:// or https:// protocol) + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + include_frames: When true, iframes are rendered inline into the returned HTML. max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is @@ -1507,6 +1536,7 @@ async def web_scrape_html( query=await async_maybe_transform( { "url": url, + "headers": headers, "include_frames": include_frames, "max_age_ms": max_age_ms, "pdf": pdf, @@ -1524,6 +1554,7 @@ async def web_scrape_images( *, url: str, enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, + headers: Dict[str, str] | Omit = omit, max_age_ms: int | Omit = omit, timeout_ms: int | Omit = omit, wait_for_ms: int | Omit = omit, @@ -1546,6 +1577,10 @@ async def web_scrape_images( enrichment: Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true. + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + max_age_ms: Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). @@ -1575,6 +1610,7 @@ async def web_scrape_images( { "url": url, "enrichment": enrichment, + "headers": headers, "max_age_ms": max_age_ms, "timeout_ms": timeout_ms, "wait_for_ms": wait_for_ms, @@ -1589,6 +1625,7 @@ async def web_scrape_md( self, *, url: str, + headers: Dict[str, str] | Omit = omit, include_frames: bool | Omit = omit, include_images: bool | Omit = omit, include_links: bool | Omit = omit, @@ -1612,6 +1649,10 @@ async def web_scrape_md( url: Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol) + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + include_frames: When true, the contents of iframes are rendered to Markdown. include_images: Include image references in Markdown output @@ -1655,6 +1696,7 @@ async def web_scrape_md( query=await async_maybe_transform( { "url": url, + "headers": headers, "include_frames": include_frames, "include_images": include_images, "include_links": include_links, @@ -1675,6 +1717,7 @@ async def web_scrape_sitemap( self, *, domain: str, + headers: Dict[str, str] | Omit = omit, max_links: int | Omit = omit, timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, @@ -1691,6 +1734,10 @@ async def web_scrape_sitemap( Args: domain: Domain to build a sitemap for + headers: Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + max_links: Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000. @@ -1719,6 +1766,7 @@ async def web_scrape_sitemap( query=await async_maybe_transform( { "domain": domain, + "headers": headers, "max_links": max_links, "timeout_ms": timeout_ms, "url_regex": url_regex, diff --git a/src/context/dev/types/web_web_scrape_html_params.py b/src/context/dev/types/web_web_scrape_html_params.py index 7b39237..f734480 100644 --- a/src/context/dev/types/web_web_scrape_html_params.py +++ b/src/context/dev/types/web_web_scrape_html_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -13,6 +14,13 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): url: Required[str] """Full URL to scrape (must include http:// or https:// protocol)""" + headers: Dict[str, str] + """ + Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + """ + include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")] """When true, iframes are rendered inline into the returned HTML.""" diff --git a/src/context/dev/types/web_web_scrape_images_params.py b/src/context/dev/types/web_web_scrape_images_params.py index ef6713d..06e282a 100644 --- a/src/context/dev/types/web_web_scrape_images_params.py +++ b/src/context/dev/types/web_web_scrape_images_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -19,6 +20,13 @@ class WebWebScrapeImagesParams(TypedDict, total=False): enrichment[resolution]=true. """ + headers: Dict[str, str] + """ + Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + """ + max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")] """Reuse a cached result this many milliseconds old or newer. diff --git a/src/context/dev/types/web_web_scrape_md_params.py b/src/context/dev/types/web_web_scrape_md_params.py index fa06876..0c27420 100644 --- a/src/context/dev/types/web_web_scrape_md_params.py +++ b/src/context/dev/types/web_web_scrape_md_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -16,6 +17,13 @@ class WebWebScrapeMdParams(TypedDict, total=False): protocol) """ + headers: Dict[str, str] + """ + Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + """ + include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")] """When true, the contents of iframes are rendered to Markdown.""" diff --git a/src/context/dev/types/web_web_scrape_sitemap_params.py b/src/context/dev/types/web_web_scrape_sitemap_params.py index 11d025e..1990d8b 100644 --- a/src/context/dev/types/web_web_scrape_sitemap_params.py +++ b/src/context/dev/types/web_web_scrape_sitemap_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -13,6 +14,13 @@ class WebWebScrapeSitemapParams(TypedDict, total=False): domain: Required[str] """Domain to build a sitemap for""" + headers: Dict[str, str] + """ + Optional outbound HTTP headers forwarded only to the target URL, sent as + deep-object query params such as headers[X-Custom]=value. When provided, caching + is bypassed: the result is neither read from nor written to cache. + """ + max_links: Annotated[int, PropertyInfo(alias="maxLinks")] """Maximum number of links to return from the sitemap crawl. diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index 7da3ee5..e90d5ee 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -413,6 +413,7 @@ def test_method_web_scrape_html(self, client: ContextDev) -> None: def test_method_web_scrape_html_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_html( url="https://example.com", + headers={"foo": "J!"}, include_frames=True, max_age_ms=0, pdf={ @@ -470,6 +471,7 @@ def test_method_web_scrape_images_with_all_params(self, client: ContextDev) -> N "max_time_per_ms": 1, "resolution": True, }, + headers={"foo": "J!"}, max_age_ms=0, timeout_ms=1000, wait_for_ms=0, @@ -515,6 +517,7 @@ def test_method_web_scrape_md(self, client: ContextDev) -> None: def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_md( url="https://example.com", + headers={"foo": "J!"}, include_frames=True, include_images=True, include_links=True, @@ -570,6 +573,7 @@ def test_method_web_scrape_sitemap(self, client: ContextDev) -> None: def test_method_web_scrape_sitemap_with_all_params(self, client: ContextDev) -> None: web = client.web.web_scrape_sitemap( domain="domain", + headers={"foo": "J!"}, max_links=1, timeout_ms=1000, url_regex="^https?://[^/]+/blog/", @@ -992,6 +996,7 @@ async def test_method_web_scrape_html(self, async_client: AsyncContextDev) -> No async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_html( url="https://example.com", + headers={"foo": "J!"}, include_frames=True, max_age_ms=0, pdf={ @@ -1049,6 +1054,7 @@ async def test_method_web_scrape_images_with_all_params(self, async_client: Asyn "max_time_per_ms": 1, "resolution": True, }, + headers={"foo": "J!"}, max_age_ms=0, timeout_ms=1000, wait_for_ms=0, @@ -1094,6 +1100,7 @@ async def test_method_web_scrape_md(self, async_client: AsyncContextDev) -> None async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_md( url="https://example.com", + headers={"foo": "J!"}, include_frames=True, include_images=True, include_links=True, @@ -1149,6 +1156,7 @@ async def test_method_web_scrape_sitemap(self, async_client: AsyncContextDev) -> async def test_method_web_scrape_sitemap_with_all_params(self, async_client: AsyncContextDev) -> None: web = await async_client.web.web_scrape_sitemap( domain="domain", + headers={"foo": "J!"}, max_links=1, timeout_ms=1000, url_regex="^https?://[^/]+/blog/",