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.19.0"
".": "0.20.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-18e7692e180f911962f33787228afa2cf31f6c05ab23c6afb1ca4f82b108fba5.yml
openapi_spec_hash: 865bd1e346267d1e33f8ca63963c6aa3
config_hash: 70354330f92ce169beabc98696ebb9a3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-f27c9584f74632a8c9603fce7190e3f63275a4ec4030da2a9475efb619618b3f.yml
openapi_spec_hash: 224cb935536a4d999d9683f8c03ea32f
config_hash: ff13935d1231ad44cd3822ffe39904b4
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.20.0 (2026-05-10)

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

### Features

* **api:** api update ([23cc0fb](https://github.com/context-dot-dev/context-python-sdk/commit/23cc0fbc81f823fb5da255c58b2f493fbcd0be68))
* **api:** api update ([e3419e4](https://github.com/context-dot-dev/context-python-sdk/commit/e3419e41b590900a86e7b69309e32b716a61c558))
* **api:** manual updates ([93da641](https://github.com/context-dot-dev/context-python-sdk/commit/93da64127f9de0af6154364d5a99b8a2b43534f8))


### Bug Fixes

* **client:** add missing f-string prefix in file type error message ([3159495](https://github.com/context-dot-dev/context-python-sdk/commit/3159495092a7800a01fe13b441ffab57618f81ea))

## 0.19.0 (2026-05-09)

Full Changelog: [v0.18.0...v0.19.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.18.0...v0.19.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/).

Use the Context Dev MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context.dev-mcp&config=eyJuYW1lIjoiY29udGV4dC5kZXYtbWNwIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vY29udGV4dC1kZXYuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1jb250ZXh0LWRldi1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context.dev-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcontext-dev.stlmcp.com%22%2C%22headers%22%3A%7B%22x-context-dev-api-key%22%3A%22My%20API%20Key%22%7D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=context-dev-mcp&config=eyJuYW1lIjoiY29udGV4dC1kZXYtbWNwIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vY29udGV4dC1kZXYuc3RsbWNwLmNvbSIsImhlYWRlcnMiOnsieC1jb250ZXh0LWRldi1hcGkta2V5IjoiTXkgQVBJIEtleSJ9fQ)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22context-dev-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcontext-dev.stlmcp.com%22%2C%22headers%22%3A%7B%22x-context-dev-api-key%22%3A%22My%20API%20Key%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

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.19.0"
version = "0.20.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/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles
elif is_sequence_t(files):
files = [(key, await _async_transform_file(file)) for key, file in files]
else:
raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence")
raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence")

return files

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.19.0" # x-release-please-version
__version__ = "0.20.0" # x-release-please-version
68 changes: 38 additions & 30 deletions src/context/dev/resources/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ def web_crawl_md(
max_age_ms: int | Omit = omit,
max_depth: int | Omit = omit,
max_pages: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_crawl_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
stop_after_ms: int | Omit = omit,
timeout_ms: int | Omit = omit,
url_regex: str | Omit = omit,
use_main_content_only: bool | Omit = omit,
Expand Down Expand Up @@ -310,12 +311,16 @@ def web_crawl_md(

max_pages: Maximum number of pages to crawl. Hard cap: 500.

parse_pdf: When true (default), PDF pages are fetched and their text layer is extracted and
converted to Markdown alongside HTML pages. When false, PDF pages are skipped
entirely (not included in results and not counted as failures).
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

shorten_base64_images: Truncate base64-encoded image data in the Markdown output

stop_after_ms: Soft time budget for the crawl in milliseconds. After each scrape, the crawler
checks the elapsed time and, if exceeded, returns the pages collected so far
instead of continuing. Min: 10000 (10s). Max: 240000 (4 min). Default: 120000 (2
min).

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).
Expand Down Expand Up @@ -348,8 +353,9 @@ def web_crawl_md(
"max_age_ms": max_age_ms,
"max_depth": max_depth,
"max_pages": max_pages,
"parse_pdf": parse_pdf,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
"stop_after_ms": stop_after_ms,
"timeout_ms": timeout_ms,
"url_regex": url_regex,
"use_main_content_only": use_main_content_only,
Expand All @@ -369,7 +375,7 @@ def web_scrape_html(
url: str,
include_frames: bool | Omit = omit,
max_age_ms: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
timeout_ms: int | Omit = omit,
wait_for_ms: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -391,9 +397,8 @@ def web_scrape_html(
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.

parse_pdf: When true (default), PDF URLs are fetched and their text layer is extracted and
returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
and a 400 WEBSITE_ACCESS_ERROR is returned.
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
Expand Down Expand Up @@ -423,7 +428,7 @@ def web_scrape_html(
"url": url,
"include_frames": include_frames,
"max_age_ms": max_age_ms,
"parse_pdf": parse_pdf,
"pdf": pdf,
"timeout_ms": timeout_ms,
"wait_for_ms": wait_for_ms,
},
Expand Down Expand Up @@ -507,7 +512,7 @@ def web_scrape_md(
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
max_age_ms: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
timeout_ms: int | Omit = omit,
use_main_content_only: bool | Omit = omit,
Expand Down Expand Up @@ -536,9 +541,8 @@ def web_scrape_md(
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.

parse_pdf: When true (default), PDF URLs are fetched and their text layer is extracted and
converted to Markdown. When false, PDF URLs are skipped and a 400
WEBSITE_ACCESS_ERROR is returned.
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

shorten_base64_images: Shorten base64-encoded image data in the Markdown output

Expand Down Expand Up @@ -574,7 +578,7 @@ def web_scrape_md(
"include_images": include_images,
"include_links": include_links,
"max_age_ms": max_age_ms,
"parse_pdf": parse_pdf,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
"timeout_ms": timeout_ms,
"use_main_content_only": use_main_content_only,
Expand Down Expand Up @@ -877,8 +881,9 @@ async def web_crawl_md(
max_age_ms: int | Omit = omit,
max_depth: int | Omit = omit,
max_pages: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_crawl_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
stop_after_ms: int | Omit = omit,
timeout_ms: int | Omit = omit,
url_regex: str | Omit = omit,
use_main_content_only: bool | Omit = omit,
Expand Down Expand Up @@ -916,12 +921,16 @@ async def web_crawl_md(

max_pages: Maximum number of pages to crawl. Hard cap: 500.

parse_pdf: When true (default), PDF pages are fetched and their text layer is extracted and
converted to Markdown alongside HTML pages. When false, PDF pages are skipped
entirely (not included in results and not counted as failures).
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

shorten_base64_images: Truncate base64-encoded image data in the Markdown output

stop_after_ms: Soft time budget for the crawl in milliseconds. After each scrape, the crawler
checks the elapsed time and, if exceeded, returns the pages collected so far
instead of continuing. Min: 10000 (10s). Max: 240000 (4 min). Default: 120000 (2
min).

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
value is 300000ms (5 minutes).
Expand Down Expand Up @@ -954,8 +963,9 @@ async def web_crawl_md(
"max_age_ms": max_age_ms,
"max_depth": max_depth,
"max_pages": max_pages,
"parse_pdf": parse_pdf,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
"stop_after_ms": stop_after_ms,
"timeout_ms": timeout_ms,
"url_regex": url_regex,
"use_main_content_only": use_main_content_only,
Expand All @@ -975,7 +985,7 @@ async def web_scrape_html(
url: str,
include_frames: bool | Omit = omit,
max_age_ms: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_scrape_html_params.Pdf | Omit = omit,
timeout_ms: int | Omit = omit,
wait_for_ms: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -997,9 +1007,8 @@ async def web_scrape_html(
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.

parse_pdf: When true (default), PDF URLs are fetched and their text layer is extracted and
returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
and a 400 WEBSITE_ACCESS_ERROR is returned.
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
than this value, it will be aborted with a 408 status code. Maximum allowed
Expand Down Expand Up @@ -1029,7 +1038,7 @@ async def web_scrape_html(
"url": url,
"include_frames": include_frames,
"max_age_ms": max_age_ms,
"parse_pdf": parse_pdf,
"pdf": pdf,
"timeout_ms": timeout_ms,
"wait_for_ms": wait_for_ms,
},
Expand Down Expand Up @@ -1113,7 +1122,7 @@ async def web_scrape_md(
include_images: bool | Omit = omit,
include_links: bool | Omit = omit,
max_age_ms: int | Omit = omit,
parse_pdf: bool | Omit = omit,
pdf: web_web_scrape_md_params.Pdf | Omit = omit,
shorten_base64_images: bool | Omit = omit,
timeout_ms: int | Omit = omit,
use_main_content_only: bool | Omit = omit,
Expand Down Expand Up @@ -1142,9 +1151,8 @@ async def web_scrape_md(
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.

parse_pdf: When true (default), PDF URLs are fetched and their text layer is extracted and
converted to Markdown. When false, PDF URLs are skipped and a 400
WEBSITE_ACCESS_ERROR is returned.
pdf: PDF parsing controls. Use start/end to limit text extraction and OCR to an
inclusive 1-based page range.

shorten_base64_images: Shorten base64-encoded image data in the Markdown output

Expand Down Expand Up @@ -1180,7 +1188,7 @@ async def web_scrape_md(
"include_images": include_images,
"include_links": include_links,
"max_age_ms": max_age_ms,
"parse_pdf": parse_pdf,
"pdf": pdf,
"shorten_base64_images": shorten_base64_images,
"timeout_ms": timeout_ms,
"use_main_content_only": use_main_content_only,
Expand Down
47 changes: 41 additions & 6 deletions src/context/dev/types/web_web_crawl_md_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .._utils import PropertyInfo

__all__ = ["WebWebCrawlMdParams"]
__all__ = ["WebWebCrawlMdParams", "Pdf"]


class WebWebCrawlMdParams(TypedDict, total=False):
Expand Down Expand Up @@ -45,16 +45,24 @@ class WebWebCrawlMdParams(TypedDict, total=False):
max_pages: Annotated[int, PropertyInfo(alias="maxPages")]
"""Maximum number of pages to crawl. Hard cap: 500."""

parse_pdf: Annotated[bool, PropertyInfo(alias="parsePDF")]
"""
When true (default), PDF pages are fetched and their text layer is extracted and
converted to Markdown alongside HTML pages. When false, PDF pages are skipped
entirely (not included in results and not counted as failures).
pdf: Pdf
"""PDF parsing controls.

Use start/end to limit text extraction and OCR to an inclusive 1-based page
range.
"""

shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
"""Truncate base64-encoded image data in the Markdown output"""

stop_after_ms: Annotated[int, PropertyInfo(alias="stopAfterMs")]
"""Soft time budget for the crawl in milliseconds.

After each scrape, the crawler checks the elapsed time and, if exceeded, returns
the pages collected so far instead of continuing. Min: 10000 (10s). Max: 240000
(4 min). Default: 120000 (2 min).
"""

timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
"""Optional timeout in milliseconds for the request.

Expand All @@ -76,3 +84,30 @@ class WebWebCrawlMdParams(TypedDict, total=False):
Optional browser wait time in milliseconds after initial page load for each
crawled page. Min: 0. Max: 30000 (30 seconds).
"""


class Pdf(TypedDict, total=False):
"""PDF parsing controls.

Use start/end to limit text extraction and OCR to an inclusive 1-based page range.
"""

end: int
"""Last 1-based PDF page to parse.

When omitted, parsing ends at the last page. Must be greater than or equal to
start when both are provided.
"""

should_parse: Annotated[bool, PropertyInfo(alias="shouldParse")]
"""When true, PDF pages are fetched and parsed.

When false, PDF pages are skipped entirely (not included in results and not
counted as failures).
"""

start: int
"""First 1-based PDF page to parse.

When omitted, parsing starts at the first page.
"""
3 changes: 2 additions & 1 deletion src/context/dev/types/web_web_crawl_md_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class Metadata(BaseModel):

num_skipped: int = FieldInfo(alias="numSkipped")
"""
Number of URLs skipped (PDFs when parsePDF=false, or URLs not matching urlRegex)
Number of URLs skipped (PDFs when pdf.shouldParse=false, or URLs not matching
urlRegex)
"""

num_succeeded: int = FieldInfo(alias="numSucceeded")
Expand Down
Loading
Loading