Skip to content

Commit 44b1e88

Browse files
authored
Merge pull request #27 from context-dot-dev/release-please--branches--main--changes--next
release: 0.23.0
2 parents 2d7037c + ae83121 commit 44b1e88

11 files changed

Lines changed: 443 additions & 8 deletions

File tree

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.22.1"
2+
".": "0.23.0"
33
}

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-c4e3d32c831ceda41c21a08b227addc6969457f9b2824f5afb4297d81ce6b379.yml
3-
openapi_spec_hash: 8e825842065c24f11fd3f51fdd705337
4-
config_hash: 70354330f92ce169beabc98696ebb9a3
1+
configured_endpoints: 23
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-24aa0941b29bf383cfb7dfb8cafd75999346bffb07b33738a89c3c9bbeb798a9.yml
3+
openapi_spec_hash: 5530a1589a20c8c337e7f6ebaaa0aecb
4+
config_hash: f481fca4de4b1657023180d4fc47ef22

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.23.0 (2026-05-16)
4+
5+
Full Changelog: [v0.22.1...v0.23.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.22.1...v0.23.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([bce4c91](https://github.com/context-dot-dev/context-python-sdk/commit/bce4c91688d28054c361ee403be2333229a33f41))
10+
311
## 0.22.1 (2026-05-13)
412

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

‎api.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from context.dev.types import (
77
WebExtractFontsResponse,
88
WebExtractStyleguideResponse,
99
WebScreenshotResponse,
10+
WebSearchResponse,
1011
WebWebCrawlMdResponse,
1112
WebWebScrapeHTMLResponse,
1213
WebWebScrapeImagesResponse,
@@ -20,6 +21,7 @@ Methods:
2021
- <code title="get /web/fonts">client.web.<a href="./src/context/dev/resources/web.py">extract_fonts</a>(\*\*<a href="src/context/dev/types/web_extract_fonts_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_fonts_response.py">WebExtractFontsResponse</a></code>
2122
- <code title="get /web/styleguide">client.web.<a href="./src/context/dev/resources/web.py">extract_styleguide</a>(\*\*<a href="src/context/dev/types/web_extract_styleguide_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_styleguide_response.py">WebExtractStyleguideResponse</a></code>
2223
- <code title="get /web/screenshot">client.web.<a href="./src/context/dev/resources/web.py">screenshot</a>(\*\*<a href="src/context/dev/types/web_screenshot_params.py">params</a>) -> <a href="./src/context/dev/types/web_screenshot_response.py">WebScreenshotResponse</a></code>
24+
- <code title="post /web/search">client.web.<a href="./src/context/dev/resources/web.py">search</a>(\*\*<a href="src/context/dev/types/web_search_params.py">params</a>) -> <a href="./src/context/dev/types/web_search_response.py">WebSearchResponse</a></code>
2325
- <code title="post /web/crawl">client.web.<a href="./src/context/dev/resources/web.py">web_crawl_md</a>(\*\*<a href="src/context/dev/types/web_web_crawl_md_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_crawl_md_response.py">WebWebCrawlMdResponse</a></code>
2426
- <code title="get /web/scrape/html">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_html</a>(\*\*<a href="src/context/dev/types/web_web_scrape_html_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_html_response.py">WebWebScrapeHTMLResponse</a></code>
2527
- <code title="get /web/scrape/images">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_images</a>(\*\*<a href="src/context/dev/types/web_web_scrape_images_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_images_response.py">WebWebScrapeImagesResponse</a></code>

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "context.dev"
3-
version = "0.22.1"
3+
version = "0.23.0"
44
description = "The official Python library for the context.dev API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

‎src/context/dev/_version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "context.dev"
4-
__version__ = "0.22.1" # x-release-please-version
4+
__version__ = "0.23.0" # x-release-please-version

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

Lines changed: 149 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import httpx
88

99
from ..types import (
10+
web_search_params,
1011
web_screenshot_params,
1112
web_web_crawl_md_params,
1213
web_extract_fonts_params,
@@ -16,7 +17,7 @@
1617
web_extract_styleguide_params,
1718
web_web_scrape_sitemap_params,
1819
)
19-
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
20+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
2021
from .._utils import maybe_transform, async_maybe_transform
2122
from .._compat import cached_property
2223
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -27,6 +28,7 @@
2728
async_to_streamed_response_wrapper,
2829
)
2930
from .._base_client import make_request_options
31+
from ..types.web_search_response import WebSearchResponse
3032
from ..types.web_screenshot_response import WebScreenshotResponse
3133
from ..types.web_web_crawl_md_response import WebWebCrawlMdResponse
3234
from ..types.web_extract_fonts_response import WebExtractFontsResponse
@@ -266,6 +268,73 @@ def screenshot(
266268
cast_to=WebScreenshotResponse,
267269
)
268270

271+
def search(
272+
self,
273+
*,
274+
query: str,
275+
exclude_domains: SequenceNotStr[str] | Omit = omit,
276+
freshness: Literal["last_24_hours", "last_week", "last_month", "last_year"] | Omit = omit,
277+
include_domains: SequenceNotStr[str] | Omit = omit,
278+
markdown_options: web_search_params.MarkdownOptions | Omit = omit,
279+
query_fanout: bool | Omit = omit,
280+
timeout_ms: int | Omit = omit,
281+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
282+
# The extra values given here take precedence over values defined on the client or passed to this method.
283+
extra_headers: Headers | None = None,
284+
extra_query: Query | None = None,
285+
extra_body: Body | None = None,
286+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
287+
) -> WebSearchResponse:
288+
"""
289+
Search the web and optionally scrape each result to Markdown in one round-trip.
290+
291+
Args:
292+
query: Natural-language search query.
293+
294+
exclude_domains: Blocklist — drop results from these domains. Example: ["pinterest.com",
295+
"reddit.com"].
296+
297+
freshness: Restrict results to content published within this window.
298+
299+
include_domains: Allowlist — only return results from these domains. Example: ["arxiv.org",
300+
"github.com"].
301+
302+
markdown_options: Inline Markdown scraping for each result. Set `enabled: true` to activate.
303+
304+
query_fanout: Expand the query into multiple parallel variants for broader recall.
305+
306+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
307+
than this value, it will be aborted with a 408 status code. Maximum allowed
308+
value is 300000ms (5 minutes).
309+
310+
extra_headers: Send extra headers
311+
312+
extra_query: Add additional query parameters to the request
313+
314+
extra_body: Add additional JSON properties to the request
315+
316+
timeout: Override the client-level default timeout for this request, in seconds
317+
"""
318+
return self._post(
319+
"/web/search",
320+
body=maybe_transform(
321+
{
322+
"query": query,
323+
"exclude_domains": exclude_domains,
324+
"freshness": freshness,
325+
"include_domains": include_domains,
326+
"markdown_options": markdown_options,
327+
"query_fanout": query_fanout,
328+
"timeout_ms": timeout_ms,
329+
},
330+
web_search_params.WebSearchParams,
331+
),
332+
options=make_request_options(
333+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
334+
),
335+
cast_to=WebSearchResponse,
336+
)
337+
269338
def web_crawl_md(
270339
self,
271340
*,
@@ -882,6 +951,73 @@ async def screenshot(
882951
cast_to=WebScreenshotResponse,
883952
)
884953

954+
async def search(
955+
self,
956+
*,
957+
query: str,
958+
exclude_domains: SequenceNotStr[str] | Omit = omit,
959+
freshness: Literal["last_24_hours", "last_week", "last_month", "last_year"] | Omit = omit,
960+
include_domains: SequenceNotStr[str] | Omit = omit,
961+
markdown_options: web_search_params.MarkdownOptions | Omit = omit,
962+
query_fanout: bool | Omit = omit,
963+
timeout_ms: int | Omit = omit,
964+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
965+
# The extra values given here take precedence over values defined on the client or passed to this method.
966+
extra_headers: Headers | None = None,
967+
extra_query: Query | None = None,
968+
extra_body: Body | None = None,
969+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
970+
) -> WebSearchResponse:
971+
"""
972+
Search the web and optionally scrape each result to Markdown in one round-trip.
973+
974+
Args:
975+
query: Natural-language search query.
976+
977+
exclude_domains: Blocklist — drop results from these domains. Example: ["pinterest.com",
978+
"reddit.com"].
979+
980+
freshness: Restrict results to content published within this window.
981+
982+
include_domains: Allowlist — only return results from these domains. Example: ["arxiv.org",
983+
"github.com"].
984+
985+
markdown_options: Inline Markdown scraping for each result. Set `enabled: true` to activate.
986+
987+
query_fanout: Expand the query into multiple parallel variants for broader recall.
988+
989+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
990+
than this value, it will be aborted with a 408 status code. Maximum allowed
991+
value is 300000ms (5 minutes).
992+
993+
extra_headers: Send extra headers
994+
995+
extra_query: Add additional query parameters to the request
996+
997+
extra_body: Add additional JSON properties to the request
998+
999+
timeout: Override the client-level default timeout for this request, in seconds
1000+
"""
1001+
return await self._post(
1002+
"/web/search",
1003+
body=await async_maybe_transform(
1004+
{
1005+
"query": query,
1006+
"exclude_domains": exclude_domains,
1007+
"freshness": freshness,
1008+
"include_domains": include_domains,
1009+
"markdown_options": markdown_options,
1010+
"query_fanout": query_fanout,
1011+
"timeout_ms": timeout_ms,
1012+
},
1013+
web_search_params.WebSearchParams,
1014+
),
1015+
options=make_request_options(
1016+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1017+
),
1018+
cast_to=WebSearchResponse,
1019+
)
1020+
8851021
async def web_crawl_md(
8861022
self,
8871023
*,
@@ -1284,6 +1420,9 @@ def __init__(self, web: WebResource) -> None:
12841420
self.screenshot = to_raw_response_wrapper(
12851421
web.screenshot,
12861422
)
1423+
self.search = to_raw_response_wrapper(
1424+
web.search,
1425+
)
12871426
self.web_crawl_md = to_raw_response_wrapper(
12881427
web.web_crawl_md,
12891428
)
@@ -1314,6 +1453,9 @@ def __init__(self, web: AsyncWebResource) -> None:
13141453
self.screenshot = async_to_raw_response_wrapper(
13151454
web.screenshot,
13161455
)
1456+
self.search = async_to_raw_response_wrapper(
1457+
web.search,
1458+
)
13171459
self.web_crawl_md = async_to_raw_response_wrapper(
13181460
web.web_crawl_md,
13191461
)
@@ -1344,6 +1486,9 @@ def __init__(self, web: WebResource) -> None:
13441486
self.screenshot = to_streamed_response_wrapper(
13451487
web.screenshot,
13461488
)
1489+
self.search = to_streamed_response_wrapper(
1490+
web.search,
1491+
)
13471492
self.web_crawl_md = to_streamed_response_wrapper(
13481493
web.web_crawl_md,
13491494
)
@@ -1374,6 +1519,9 @@ def __init__(self, web: AsyncWebResource) -> None:
13741519
self.screenshot = async_to_streamed_response_wrapper(
13751520
web.screenshot,
13761521
)
1522+
self.search = async_to_streamed_response_wrapper(
1523+
web.search,
1524+
)
13771525
self.web_crawl_md = async_to_streamed_response_wrapper(
13781526
web.web_crawl_md,
13791527
)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from __future__ import annotations
44

5+
from .web_search_params import WebSearchParams as WebSearchParams
56
from .ai_ai_query_params import AIAIQueryParams as AIAIQueryParams
7+
from .web_search_response import WebSearchResponse as WebSearchResponse
68
from .ai_ai_query_response import AIAIQueryResponse as AIAIQueryResponse
79
from .brand_retrieve_params import BrandRetrieveParams as BrandRetrieveParams
810
from .web_screenshot_params import WebScreenshotParams as WebScreenshotParams
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, Annotated, TypedDict
6+
7+
from .._types import SequenceNotStr
8+
from .._utils import PropertyInfo
9+
10+
__all__ = ["WebSearchParams", "MarkdownOptions", "MarkdownOptionsPdf"]
11+
12+
13+
class WebSearchParams(TypedDict, total=False):
14+
query: Required[str]
15+
"""Natural-language search query."""
16+
17+
exclude_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeDomains")]
18+
"""Blocklist — drop results from these domains.
19+
20+
Example: ["pinterest.com", "reddit.com"].
21+
"""
22+
23+
freshness: Literal["last_24_hours", "last_week", "last_month", "last_year"]
24+
"""Restrict results to content published within this window."""
25+
26+
include_domains: Annotated[SequenceNotStr[str], PropertyInfo(alias="includeDomains")]
27+
"""Allowlist — only return results from these domains.
28+
29+
Example: ["arxiv.org", "github.com"].
30+
"""
31+
32+
markdown_options: Annotated[MarkdownOptions, PropertyInfo(alias="markdownOptions")]
33+
"""Inline Markdown scraping for each result. Set `enabled: true` to activate."""
34+
35+
query_fanout: Annotated[bool, PropertyInfo(alias="queryFanout")]
36+
"""Expand the query into multiple parallel variants for broader recall."""
37+
38+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
39+
"""Optional timeout in milliseconds for the request.
40+
41+
If the request takes longer than this value, it will be aborted with a 408
42+
status code. Maximum allowed value is 300000ms (5 minutes).
43+
"""
44+
45+
46+
class MarkdownOptionsPdf(TypedDict, total=False):
47+
"""PDF handling. Use start/end to bound text extraction and OCR to a page range."""
48+
49+
end: int
50+
"""Last PDF page to parse (1-based, inclusive).
51+
52+
Defaults to the final page. Must be >= start.
53+
"""
54+
55+
should_parse: Annotated[bool, PropertyInfo(alias="shouldParse")]
56+
"""Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR."""
57+
58+
start: int
59+
"""First PDF page to parse (1-based, inclusive). Defaults to page 1."""
60+
61+
62+
class MarkdownOptions(TypedDict, total=False):
63+
"""Inline Markdown scraping for each result. Set `enabled: true` to activate."""
64+
65+
enabled: bool
66+
"""Scrape each result to Markdown. Off by default to keep search cheap and fast."""
67+
68+
include_frames: Annotated[bool, PropertyInfo(alias="includeFrames")]
69+
"""Render iframe contents into the Markdown."""
70+
71+
include_images: Annotated[bool, PropertyInfo(alias="includeImages")]
72+
"""Emit image references in the Markdown."""
73+
74+
include_links: Annotated[bool, PropertyInfo(alias="includeLinks")]
75+
"""Keep hyperlinks in the Markdown."""
76+
77+
max_age_ms: Annotated[int, PropertyInfo(alias="maxAgeMs")]
78+
"""Cache TTL in ms for scraped Markdown keyed by URL + options.
79+
80+
Default 1 day, max 30 days. Set to 0 to force a fresh scrape.
81+
"""
82+
83+
pdf: MarkdownOptionsPdf
84+
"""PDF handling. Use start/end to bound text extraction and OCR to a page range."""
85+
86+
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
87+
"""Truncate inline base64 image payloads to keep responses small."""
88+
89+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
90+
"""Optional timeout in milliseconds for the request.
91+
92+
If the request takes longer than this value, it will be aborted with a 408
93+
status code. Maximum allowed value is 300000ms (5 minutes).
94+
"""
95+
96+
use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")]
97+
"""Strip nav, header, footer, and sidebar — keep only the primary article content."""
98+
99+
wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")]
100+
"""Extra wait after page load before rendering, in ms (0–30000).
101+
102+
Useful for JS-heavy pages.
103+
"""

0 commit comments

Comments
 (0)