Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.31.0"
".": "0.32.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-de0ba2ed18ec7265b0b20d9639b3da207dd33e354f0a856091902291c6661830.yml
openapi_spec_hash: ae25efc2ac6bcab54bc3f4efaab73a55
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8f6bc62256b5a4aa44e82389bfefee1d73172856c407567bba11a82fd4203641.yml
openapi_spec_hash: 8b7230de56ecbec4712fa1e81067a75c
config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.32.0 (2026-06-07)

Full Changelog: [v0.31.0...v0.32.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.31.0...v0.32.0)

### Features

* **api:** api update ([7ef921a](https://github.com/context-dot-dev/context-python-sdk/commit/7ef921a84ef020f5c31458d3975be33e5befd065))

## 0.31.0 (2026-06-07)

Full Changelog: [v0.30.0...v0.31.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.30.0...v0.31.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "context.dev"
version = "0.31.0"
version = "0.32.0"
description = "The official Python library for the context.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/context/dev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "context.dev"
__version__ = "0.31.0" # x-release-please-version
__version__ = "0.32.0" # x-release-please-version
74 changes: 74 additions & 0 deletions src/context/dev/resources/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,12 @@ def web_crawl_md(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
follow_subdomains: bool | Omit = omit,
include_frames: bool | Omit = omit,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
max_depth: int | Omit = omit,
max_pages: int | Omit = omit,
Expand All @@ -531,6 +533,10 @@ def web_crawl_md(
Args:
url: The starting URL for the crawl (must include http:// or https:// protocol)

exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
Applied after includeSelectors. Exclusion takes precedence: an element matching
both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".

follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
docs.example.com when starting from example.com). www and apex are always
treated as equivalent.
Expand All @@ -542,6 +548,11 @@ def web_crawl_md(

include_links: Preserve hyperlinks in the Markdown output

include_selectors: CSS selectors. When provided, only matching HTML subtrees (and their
descendants) are kept before each crawled page is converted to Markdown. When
omitted, the entire document is kept. Examples: "article.main", "#content",
"[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -585,10 +596,12 @@ def web_crawl_md(
body=maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"follow_subdomains": follow_subdomains,
"include_frames": include_frames,
"include_images": include_images,
"include_links": include_links,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"max_depth": max_depth,
"max_pages": max_pages,
Expand All @@ -612,8 +625,10 @@ def web_scrape_html(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
headers: Dict[str, str] | Omit = omit,
include_frames: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
timeout_ms: int | Omit = omit,
Expand All @@ -631,12 +646,20 @@ def web_scrape_html(
Args:
url: Full URL to scrape (must include http:// or https:// protocol)

exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
Exclusion takes precedence: an element matching both is removed. Examples:
"nav", "footer", ".ad-banner", "[aria-hidden=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.

include_frames: When true, iframes are rendered inline into the returned HTML.

include_selectors: CSS selectors. When provided, only matching subtrees (and their descendants) are
kept and everything else is dropped. When omitted, the entire document is kept.
Examples: "article.main", "#content", "[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -670,8 +693,10 @@ def web_scrape_html(
query=maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"headers": headers,
"include_frames": include_frames,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"pdf": pdf,
"timeout_ms": timeout_ms,
Expand Down Expand Up @@ -759,10 +784,12 @@ def web_scrape_md(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
headers: Dict[str, str] | Omit = omit,
include_frames: bool | Omit = omit,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
Expand All @@ -783,6 +810,10 @@ def web_scrape_md(
url: Full URL to scrape into LLM usable Markdown (must include http:// or https://
protocol)

exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
includeSelectors. Exclusion takes precedence: an element matching both is
removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=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.
Expand All @@ -793,6 +824,10 @@ def web_scrape_md(

include_links: Preserve hyperlinks in Markdown output

include_selectors: CSS selectors. When provided, only matching HTML subtrees (and their
descendants) are kept before conversion to Markdown. When omitted, the entire
document is kept. Examples: "article.main", "#content", "[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -830,10 +865,12 @@ def web_scrape_md(
query=maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"headers": headers,
"include_frames": include_frames,
"include_images": include_images,
"include_links": include_links,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
Expand Down Expand Up @@ -1369,10 +1406,12 @@ async def web_crawl_md(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
follow_subdomains: bool | Omit = omit,
include_frames: bool | Omit = omit,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
max_depth: int | Omit = omit,
max_pages: int | Omit = omit,
Expand All @@ -1397,6 +1436,10 @@ async def web_crawl_md(
Args:
url: The starting URL for the crawl (must include http:// or https:// protocol)

exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
Applied after includeSelectors. Exclusion takes precedence: an element matching
both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".

follow_subdomains: When true, follow links on subdomains of the starting URL's domain (e.g.
docs.example.com when starting from example.com). www and apex are always
treated as equivalent.
Expand All @@ -1408,6 +1451,11 @@ async def web_crawl_md(

include_links: Preserve hyperlinks in the Markdown output

include_selectors: CSS selectors. When provided, only matching HTML subtrees (and their
descendants) are kept before each crawled page is converted to Markdown. When
omitted, the entire document is kept. Examples: "article.main", "#content",
"[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -1451,10 +1499,12 @@ async def web_crawl_md(
body=await async_maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"follow_subdomains": follow_subdomains,
"include_frames": include_frames,
"include_images": include_images,
"include_links": include_links,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"max_depth": max_depth,
"max_pages": max_pages,
Expand All @@ -1478,8 +1528,10 @@ async def web_scrape_html(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
headers: Dict[str, str] | Omit = omit,
include_frames: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
timeout_ms: int | Omit = omit,
Expand All @@ -1497,12 +1549,20 @@ async def web_scrape_html(
Args:
url: Full URL to scrape (must include http:// or https:// protocol)

exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
Exclusion takes precedence: an element matching both is removed. Examples:
"nav", "footer", ".ad-banner", "[aria-hidden=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.

include_frames: When true, iframes are rendered inline into the returned HTML.

include_selectors: CSS selectors. When provided, only matching subtrees (and their descendants) are
kept and everything else is dropped. When omitted, the entire document is kept.
Examples: "article.main", "#content", "[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -1536,8 +1596,10 @@ async def web_scrape_html(
query=await async_maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"headers": headers,
"include_frames": include_frames,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"pdf": pdf,
"timeout_ms": timeout_ms,
Expand Down Expand Up @@ -1625,10 +1687,12 @@ async def web_scrape_md(
self,
*,
url: str,
exclude_selectors: SequenceNotStr[str] | Omit = omit,
headers: Dict[str, str] | Omit = omit,
include_frames: bool | Omit = omit,
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
include_selectors: SequenceNotStr[str] | Omit = omit,
max_age_ms: int | Omit = omit,
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
Expand All @@ -1649,6 +1713,10 @@ async def web_scrape_md(
url: Full URL to scrape into LLM usable Markdown (must include http:// or https://
protocol)

exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
includeSelectors. Exclusion takes precedence: an element matching both is
removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=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.
Expand All @@ -1659,6 +1727,10 @@ async def web_scrape_md(

include_links: Preserve hyperlinks in Markdown output

include_selectors: CSS selectors. When provided, only matching HTML subtrees (and their
descendants) are kept before conversion to Markdown. When omitted, the entire
document is kept. Examples: "article.main", "#content", "[role=main]".

max_age_ms: Return a cached result if a prior scrape for the same parameters exists and is
younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
Expand Down Expand Up @@ -1696,10 +1768,12 @@ async def web_scrape_md(
query=await async_maybe_transform(
{
"url": url,
"exclude_selectors": exclude_selectors,
"headers": headers,
"include_frames": include_frames,
"include_images": include_images,
"include_links": include_links,
"include_selectors": include_selectors,
"max_age_ms": max_age_ms,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
Expand Down
16 changes: 16 additions & 0 deletions src/context/dev/types/web_web_crawl_md_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from typing_extensions import Required, Annotated, TypedDict

from .._types import SequenceNotStr
from .._utils import PropertyInfo

__all__ = ["WebWebCrawlMdParams", "Pdf"]
Expand All @@ -13,6 +14,13 @@ class WebWebCrawlMdParams(TypedDict, total=False):
url: Required[str]
"""The starting URL for the crawl (must include http:// or https:// protocol)"""

exclude_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeSelectors")]
"""CSS selectors to remove before each crawled page is converted to Markdown.

Applied after includeSelectors. Exclusion takes precedence: an element matching
both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
"""

follow_subdomains: Annotated[bool, PropertyInfo(alias="followSubdomains")]
"""When true, follow links on subdomains of the starting URL's domain (e.g.

Expand All @@ -32,6 +40,14 @@ class WebWebCrawlMdParams(TypedDict, total=False):
include_links: Annotated[bool, PropertyInfo(alias="includeLinks")]
"""Preserve hyperlinks in the Markdown output"""

include_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="includeSelectors")]
"""CSS selectors.

When provided, only matching HTML subtrees (and their descendants) are kept
before each crawled page is converted to Markdown. When omitted, the entire
document is kept. Examples: "article.main", "#content", "[role=main]".
"""

max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
"""
Return a cached result if a prior scrape for the same parameters exists and is
Expand Down
16 changes: 16 additions & 0 deletions src/context/dev/types/web_web_scrape_html_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Dict
from typing_extensions import Required, Annotated, TypedDict

from .._types import SequenceNotStr
from .._utils import PropertyInfo

__all__ = ["WebWebScrapeHTMLParams", "Pdf"]
Expand All @@ -14,6 +15,13 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
url: Required[str]
"""Full URL to scrape (must include http:// or https:// protocol)"""

exclude_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeSelectors")]
"""CSS selectors to remove from the result.

Applied after includeSelectors. Exclusion takes precedence: an element matching
both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
"""

headers: Dict[str, str]
"""
Optional outbound HTTP headers forwarded only to the target URL, sent as
Expand All @@ -24,6 +32,14 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")]
"""When true, iframes are rendered inline into the returned HTML."""

include_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="includeSelectors")]
"""CSS selectors.

When provided, only matching subtrees (and their descendants) are kept and
everything else is dropped. When omitted, the entire document is kept. Examples:
"article.main", "#content", "[role=main]".
"""

max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
"""
Return a cached result if a prior scrape for the same parameters exists and is
Expand Down
Loading
Loading