Skip to content

Commit f548d59

Browse files
authored
Merge pull request #58 from context-dot-dev/release-please--branches--main--changes--next
release: 2.12.0
2 parents bcf3ab6 + 7cd74ed commit f548d59

17 files changed

Lines changed: 326 additions & 36 deletions

‎.release-please-manifest.json‎

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

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 41
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b0c72d2fe5911c9ce155275b954198bf2152e915a7e5b9f719aad50e222b9ef8.yml
3-
openapi_spec_hash: 5cf943ea5718059b7975417b012cee28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2c3f4e4b357ca78c019a3aacd006e2bb8b332d4172a300ee6c46c076a216ed3f.yml
3+
openapi_spec_hash: b89be415cf6ee594b521885a9deb25ac
44
config_hash: 0fb0ceca5946298c416cec0cca5260c7

‎CHANGELOG.md‎

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

3+
## 2.12.0 (2026-08-23)
4+
5+
Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.11.0...v2.12.0)
6+
7+
### Features
8+
9+
* **api:** api update ([3c5c2c3](https://github.com/context-dot-dev/context-python-sdk/commit/3c5c2c39164d0be19c17949180c73937140687ea))
10+
* **api:** api update ([3a29950](https://github.com/context-dot-dev/context-python-sdk/commit/3a29950c03cfa9deab35b08061f295d5a2b2c092))
11+
* **api:** api update ([0a68836](https://github.com/context-dot-dev/context-python-sdk/commit/0a68836a31d685598a8f491f723970f8ea4e71f8))
12+
* **api:** api update ([288c743](https://github.com/context-dot-dev/context-python-sdk/commit/288c7436453a199728d8b9407c0a51e83e0c0718))
13+
314
## 2.11.0 (2026-08-18)
415

516
Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.10.0...v2.11.0)

‎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 = "2.11.0"
3+
version = "2.12.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__ = "2.11.0" # x-release-please-version
4+
__version__ = "2.12.0" # x-release-please-version

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

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def extract(
7171
*,
7272
schema: Dict[str, object],
7373
url: str,
74+
actions: Iterable[web_extract_params.Action] | Omit = omit,
7475
fact_check: bool | Omit = omit,
7576
follow_subdomains: bool | Omit = omit,
7677
include_frames: bool | Omit = omit,
@@ -96,13 +97,20 @@ def extract(
9697
relevant internal links, and extract structured data from the selected pages.
9798
9899
Args:
99-
schema: JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
100-
Schema generated from a Zod object; Python users can pass the equivalent JSON
101-
Schema object.
100+
schema: JSON Schema for the returned data object. Image fields such as `image_urls` or
101+
`product_photos` automatically make page image references available to
102+
extraction, so product data and photos can be returned in one call. TypeScript
103+
Zod users can pass a JSON Schema generated from a Zod object; Python users can
104+
pass the equivalent JSON Schema object.
102105
103106
url: The starting website URL to crawl and extract from. Must include http:// or
104107
https://.
105108
109+
actions: Optional browser actions executed in order on the requested page after it loads,
110+
before links are discovered or additional pages are crawled. Requires a paid
111+
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
112+
defaults to 110000 ms.
113+
106114
fact_check: When true, every returned value must be grounded in facts stated on the page;
107115
fields that cannot be supported by the page are returned as null/empty. When
108116
false (default), the model may make reasonable inferences and derivations from
@@ -130,7 +138,8 @@ def extract(
130138
exchange for more stable output on animated pages.
131139
132140
stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
133-
(110s). Default: 80000 (80s).
141+
(110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
142+
provided.
134143
135144
tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
136145
@@ -155,6 +164,7 @@ def extract(
155164
{
156165
"schema": schema,
157166
"url": url,
167+
"actions": actions,
158168
"fact_check": fact_check,
159169
"follow_subdomains": follow_subdomains,
160170
"include_frames": include_frames,
@@ -1338,13 +1348,15 @@ def web_crawl_md(
13381348
than this value, it will be aborted with a 408 status code. Maximum allowed
13391349
value is 300000ms (5 minutes).
13401350
1341-
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
1351+
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped. An
1352+
automatic prefix scope in the form ^<starting URL> follows a redirect of the
1353+
starting page.
13421354
13431355
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
13441356
navigation
13451357
1346-
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
1347-
crawled page. Min: 0. Max: 30000 (30 seconds).
1358+
wait_for_ms: Browser wait time in milliseconds after initial page load for each crawled page.
1359+
Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).
13481360
13491361
zdr: Set to enabled to bypass shared caches and omit request and response content
13501362
from retained usage logs. Requires zero data retention to be enabled for your
@@ -2309,6 +2321,7 @@ async def extract(
23092321
*,
23102322
schema: Dict[str, object],
23112323
url: str,
2324+
actions: Iterable[web_extract_params.Action] | Omit = omit,
23122325
fact_check: bool | Omit = omit,
23132326
follow_subdomains: bool | Omit = omit,
23142327
include_frames: bool | Omit = omit,
@@ -2334,13 +2347,20 @@ async def extract(
23342347
relevant internal links, and extract structured data from the selected pages.
23352348
23362349
Args:
2337-
schema: JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
2338-
Schema generated from a Zod object; Python users can pass the equivalent JSON
2339-
Schema object.
2350+
schema: JSON Schema for the returned data object. Image fields such as `image_urls` or
2351+
`product_photos` automatically make page image references available to
2352+
extraction, so product data and photos can be returned in one call. TypeScript
2353+
Zod users can pass a JSON Schema generated from a Zod object; Python users can
2354+
pass the equivalent JSON Schema object.
23402355
23412356
url: The starting website URL to crawl and extract from. Must include http:// or
23422357
https://.
23432358
2359+
actions: Optional browser actions executed in order on the requested page after it loads,
2360+
before links are discovered or additional pages are crawled. Requires a paid
2361+
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
2362+
defaults to 110000 ms.
2363+
23442364
fact_check: When true, every returned value must be grounded in facts stated on the page;
23452365
fields that cannot be supported by the page are returned as null/empty. When
23462366
false (default), the model may make reasonable inferences and derivations from
@@ -2368,7 +2388,8 @@ async def extract(
23682388
exchange for more stable output on animated pages.
23692389
23702390
stop_after_ms: Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000
2371-
(110s). Default: 80000 (80s).
2391+
(110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are
2392+
provided.
23722393
23732394
tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
23742395
@@ -2393,6 +2414,7 @@ async def extract(
23932414
{
23942415
"schema": schema,
23952416
"url": url,
2417+
"actions": actions,
23962418
"fact_check": fact_check,
23972419
"follow_subdomains": follow_subdomains,
23982420
"include_frames": include_frames,
@@ -3576,13 +3598,15 @@ async def web_crawl_md(
35763598
than this value, it will be aborted with a 408 status code. Maximum allowed
35773599
value is 300000ms (5 minutes).
35783600
3579-
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped.
3601+
url_regex: Regex pattern. Only URLs matching this pattern will be followed and scraped. An
3602+
automatic prefix scope in the form ^<starting URL> follows a redirect of the
3603+
starting page.
35803604
35813605
use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and
35823606
navigation
35833607
3584-
wait_for_ms: Optional browser wait time in milliseconds after initial page load for each
3585-
crawled page. Min: 0. Max: 30000 (30 seconds).
3608+
wait_for_ms: Browser wait time in milliseconds after initial page load for each crawled page.
3609+
Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).
35863610
35873611
zdr: Set to enabled to bypass shared caches and omit request and response content
35883612
from retained usage logs. Requires zero data retention to be enabled for your

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ class Product(BaseModel):
4545
target_audience: List[str]
4646
"""Target audience for the product (array of strings)"""
4747

48+
availability: Optional[
49+
Literal[
50+
"in_stock", "out_of_stock", "limited_availability", "preorder", "backorder", "made_to_order", "discontinued"
51+
]
52+
] = None
53+
"""Normalized stock or ordering availability"""
54+
4855
billing_frequency: Optional[Literal["monthly", "yearly", "one_time", "usage_based"]] = None
4956
"""Billing frequency for the product"""
5057

@@ -54,6 +61,11 @@ class Product(BaseModel):
5461
currency: Optional[str] = None
5562
"""Currency code for the price (e.g., USD, EUR)"""
5663

64+
dimensions: Optional[List[str]] = None
65+
"""
66+
Dimension statements shown for the product, preserving labels, values, and units
67+
"""
68+
5769
image_url: Optional[str] = None
5870
"""URL to the product image"""
5971

@@ -63,6 +75,9 @@ class Product(BaseModel):
6375
pricing_model: Optional[Literal["per_seat", "flat", "tiered", "freemium", "custom"]] = None
6476
"""Pricing model for the product"""
6577

78+
regular_price: Optional[float] = None
79+
"""Original or regular price before a displayed discount"""
80+
6681
url: Optional[str] = None
6782
"""URL to the product page"""
6883

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ class Product(BaseModel):
4343
target_audience: List[str]
4444
"""Target audience for the product (array of strings)"""
4545

46+
availability: Optional[
47+
Literal[
48+
"in_stock", "out_of_stock", "limited_availability", "preorder", "backorder", "made_to_order", "discontinued"
49+
]
50+
] = None
51+
"""Normalized stock or ordering availability"""
52+
4653
billing_frequency: Optional[Literal["monthly", "yearly", "one_time", "usage_based"]] = None
4754
"""Billing frequency for the product"""
4855

@@ -52,6 +59,11 @@ class Product(BaseModel):
5259
currency: Optional[str] = None
5360
"""Currency code for the price (e.g., USD, EUR)"""
5461

62+
dimensions: Optional[List[str]] = None
63+
"""
64+
Dimension statements shown for the product, preserving labels, values, and units
65+
"""
66+
5567
image_url: Optional[str] = None
5668
"""URL to the product image"""
5769

@@ -61,6 +73,9 @@ class Product(BaseModel):
6173
pricing_model: Optional[Literal["per_seat", "flat", "tiered", "freemium", "custom"]] = None
6274
"""Pricing model for the product"""
6375

76+
regular_price: Optional[float] = None
77+
"""Original or regular price before a displayed discount"""
78+
6479
url: Optional[str] = None
6580
"""URL to the product page"""
6681

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class FilterBy(TypedDict, total=False):
218218
"cg",
219219
"ch",
220220
"cl",
221+
"cz",
221222
"de",
222223
"fi",
223224
"fr",

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

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,30 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict
6-
from typing_extensions import Required, Annotated, TypedDict
5+
from typing import Dict, Union, Iterable
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["WebExtractParams", "Pdf"]
11+
__all__ = [
12+
"WebExtractParams",
13+
"Action",
14+
"ActionWebScrapeWaitAction",
15+
"ActionWebScrapePerformAction",
16+
"ActionWebScrapeScrollAction",
17+
"Pdf",
18+
]
1219

1320

1421
class WebExtractParams(TypedDict, total=False):
1522
schema: Required[Dict[str, object]]
1623
"""JSON Schema for the returned data object.
1724
18-
TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python
19-
users can pass the equivalent JSON Schema object.
25+
Image fields such as `image_urls` or `product_photos` automatically make page
26+
image references available to extraction, so product data and photos can be
27+
returned in one call. TypeScript Zod users can pass a JSON Schema generated from
28+
a Zod object; Python users can pass the equivalent JSON Schema object.
2029
"""
2130

2231
url: Required[str]
@@ -25,6 +34,14 @@ class WebExtractParams(TypedDict, total=False):
2534
Must include http:// or https://.
2635
"""
2736

37+
actions: Iterable[Action]
38+
"""
39+
Optional browser actions executed in order on the requested page after it loads,
40+
before links are discovered or additional pages are crawled. Requires a paid
41+
plan. When actions are provided and stopAfterMs is omitted, the crawl budget
42+
defaults to 110000 ms.
43+
"""
44+
2845
fact_check: Annotated[bool, PropertyInfo(alias="factCheck")]
2946
"""
3047
When true, every returned value must be grounded in facts stated on the page;
@@ -74,7 +91,8 @@ class WebExtractParams(TypedDict, total=False):
7491
stop_after_ms: Annotated[int, PropertyInfo(alias="stopAfterMs")]
7592
"""Soft time budget for the crawl in milliseconds.
7693
77-
Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).
94+
Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s)
95+
when browser actions are provided.
7896
"""
7997

8098
tags: SequenceNotStr[str]
@@ -94,6 +112,51 @@ class WebExtractParams(TypedDict, total=False):
94112
"""
95113

96114

115+
class ActionWebScrapeWaitAction(TypedDict, total=False):
116+
"""Pause for a fixed number of milliseconds before continuing to the next action."""
117+
118+
do: Required[Literal["wait"]]
119+
120+
time_ms: Required[Annotated[int, PropertyInfo(alias="timeMs")]]
121+
122+
123+
class ActionWebScrapePerformAction(TypedDict, total=False):
124+
"""Resolve and perform one natural-language browser action."""
125+
126+
action: Required[str]
127+
128+
do: Required[Literal["perform"]]
129+
130+
131+
class ActionWebScrapeScrollAction(TypedDict, total=False):
132+
"""
133+
Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
134+
"""
135+
136+
do: Required[Literal["scroll"]]
137+
138+
amount: Union[int, Literal["viewport", "max"]]
139+
"""Pixels per scroll, one visible viewport, or the current scroll boundary.
140+
141+
Defaults to viewport.
142+
"""
143+
144+
container: str
145+
"""CSS selector for the first matching scroll container. Defaults to the page."""
146+
147+
direction: Literal["up", "down", "left", "right"]
148+
"""Direction to scroll. Defaults to down."""
149+
150+
max_scrolls: Annotated[int, PropertyInfo(alias="maxScrolls")]
151+
"""Maximum scroll iterations.
152+
153+
Stops early when scrolling and scrollable extent stop changing. Defaults to 1.
154+
"""
155+
156+
157+
Action: TypeAlias = Union[ActionWebScrapeWaitAction, ActionWebScrapePerformAction, ActionWebScrapeScrollAction]
158+
159+
97160
class Pdf(TypedDict, total=False):
98161
end: int
99162
"""Last 1-based PDF page to parse.

0 commit comments

Comments
 (0)