Skip to content

Commit 3f3a903

Browse files
feat(api): api update
1 parent 226b29c commit 3f3a903

8 files changed

Lines changed: 72 additions & 14 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 32
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2bf2b44f6593c44b2948683469bbb2b09cd8e90c97b12057fac6220cf0d2eee7.yml
3-
openapi_spec_hash: ae8b5109ec997cac8d3e6ec96040f6c8
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-91f4286859fc23813c5255b877395c87dd81520c3913fdfdae3cfa343e1a4873.yml
3+
openapi_spec_hash: 71746b5b65f20617ee021e071d5f7f92
44
config_hash: 70e7e80b5e87f94981bee396c6cd41e8

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,21 @@ class MonitorCreateParams(TypedDict, total=False):
5454

5555

5656
class TargetMonitorsPageTarget(TypedDict, total=False):
57-
"""Watch a single web page."""
57+
"""Watch a single web page.
58+
59+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
60+
"""
5861

5962
type: Required[Literal["page"]]
6063

6164
url: Required[str]
6265

66+
instructions: str
67+
"""Plain-language goal describing which page changes matter.
68+
69+
When provided without change_detection, semantic detection is inferred.
70+
"""
71+
6372
normalize_whitespace: bool
6473
"""Normalize whitespace before comparing or analyzing text."""
6574

@@ -137,7 +146,7 @@ class ChangeDetectionMonitorsExactChangeDetection(TypedDict, total=False):
137146

138147
class ChangeDetectionMonitorsSemanticChangeDetection(TypedDict, total=False):
139148
"""
140-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
149+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
141150
"""
142151

143152
type: Required[Literal["semantic"]]

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
4040

4141
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
4242
"""
43-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
43+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
4444
"""
4545

4646
type: Literal["semantic"]
@@ -74,12 +74,21 @@ class Schedule(BaseModel):
7474

7575

7676
class TargetMonitorsPageTarget(BaseModel):
77-
"""Watch a single web page."""
77+
"""Watch a single web page.
78+
79+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
80+
"""
7881

7982
type: Literal["page"]
8083

8184
url: str
8285

86+
instructions: Optional[str] = None
87+
"""Plain-language goal describing which page changes matter.
88+
89+
When provided without change_detection, semantic detection is inferred.
90+
"""
91+
8392
normalize_whitespace: Optional[bool] = None
8493
"""Normalize whitespace before comparing or analyzing text."""
8594

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DataChangeDetectionMonitorsExactChangeDetection(BaseModel):
4141

4242
class DataChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
4343
"""
44-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
44+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
4545
"""
4646

4747
type: Literal["semantic"]
@@ -75,12 +75,21 @@ class DataSchedule(BaseModel):
7575

7676

7777
class DataTargetMonitorsPageTarget(BaseModel):
78-
"""Watch a single web page."""
78+
"""Watch a single web page.
79+
80+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
81+
"""
7982

8083
type: Literal["page"]
8184

8285
url: str
8386

87+
instructions: Optional[str] = None
88+
"""Plain-language goal describing which page changes matter.
89+
90+
When provided without change_detection, semantic detection is inferred.
91+
"""
92+
8493
normalize_whitespace: Optional[bool] = None
8594
"""Normalize whitespace before comparing or analyzing text."""
8695

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
4040

4141
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
4242
"""
43-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
43+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
4444
"""
4545

4646
type: Literal["semantic"]
@@ -74,12 +74,21 @@ class Schedule(BaseModel):
7474

7575

7676
class TargetMonitorsPageTarget(BaseModel):
77-
"""Watch a single web page."""
77+
"""Watch a single web page.
78+
79+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
80+
"""
7881

7982
type: Literal["page"]
8083

8184
url: str
8285

86+
instructions: Optional[str] = None
87+
"""Plain-language goal describing which page changes matter.
88+
89+
When provided without change_detection, semantic detection is inferred.
90+
"""
91+
8392
normalize_whitespace: Optional[bool] = None
8493
"""Normalize whitespace before comparing or analyzing text."""
8594

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ChangeDetectionMonitorsExactChangeDetection(TypedDict, total=False):
6060

6161
class ChangeDetectionMonitorsSemanticChangeDetection(TypedDict, total=False):
6262
"""
63-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
63+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
6464
"""
6565

6666
type: Required[Literal["semantic"]]
@@ -93,12 +93,21 @@ class Schedule(TypedDict, total=False):
9393

9494

9595
class TargetMonitorsPageTarget(TypedDict, total=False):
96-
"""Watch a single web page."""
96+
"""Watch a single web page.
97+
98+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
99+
"""
97100

98101
type: Required[Literal["page"]]
99102

100103
url: Required[str]
101104

105+
instructions: str
106+
"""Plain-language goal describing which page changes matter.
107+
108+
When provided without change_detection, semantic detection is inferred.
109+
"""
110+
102111
normalize_whitespace: bool
103112
"""Normalize whitespace before comparing or analyzing text."""
104113

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
4040

4141
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
4242
"""
43-
Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
43+
Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
4444
"""
4545

4646
type: Literal["semantic"]
@@ -74,12 +74,21 @@ class Schedule(BaseModel):
7474

7575

7676
class TargetMonitorsPageTarget(BaseModel):
77-
"""Watch a single web page."""
77+
"""Watch a single web page.
78+
79+
Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
80+
"""
7881

7982
type: Literal["page"]
8083

8184
url: str
8285

86+
instructions: Optional[str] = None
87+
"""Plain-language goal describing which page changes matter.
88+
89+
When provided without change_detection, semantic detection is inferred.
90+
"""
91+
8392
normalize_whitespace: Optional[bool] = None
8493
"""Normalize whitespace before comparing or analyzing text."""
8594

‎tests/api_resources/test_monitors.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: ContextDev) -> None:
5252
target={
5353
"type": "page",
5454
"url": "https://acme.com/pricing",
55+
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
5556
"normalize_whitespace": True,
5657
},
5758
change_detection={"type": "exact"},
@@ -170,6 +171,7 @@ def test_method_update_with_all_params(self, client: ContextDev) -> None:
170171
target={
171172
"type": "page",
172173
"url": "https://acme.com/pricing",
174+
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
173175
"normalize_whitespace": True,
174176
},
175177
webhook={
@@ -664,6 +666,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncContextDev
664666
target={
665667
"type": "page",
666668
"url": "https://acme.com/pricing",
669+
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
667670
"normalize_whitespace": True,
668671
},
669672
change_detection={"type": "exact"},
@@ -782,6 +785,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncContextDev
782785
target={
783786
"type": "page",
784787
"url": "https://acme.com/pricing",
788+
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
785789
"normalize_whitespace": True,
786790
},
787791
webhook={

0 commit comments

Comments
 (0)