Skip to content

Commit b34463f

Browse files
feat(api): api update
1 parent 964c4b0 commit b34463f

10 files changed

Lines changed: 76 additions & 48 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fa5c7cd62da1c7cb2eddf8c6bb1f32ca7f958be5c3c315ade6ca0a669814d75a.yml
3-
openapi_spec_hash: 8358c1a467ab971afd59d615d1e731ee
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b075e5704110b3c03bd81b41f62b836d7624eceed7feb0ac63720dec9a4cbba4.yml
3+
openapi_spec_hash: 5efb926e6e99163e3e42a98986da8335
44
config_hash: ff35e224e809656528c44163aa41bebd

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def list(
239239
cursor: str | Omit = omit,
240240
limit: int | Omit = omit,
241241
q: str | Omit = omit,
242-
search_by: List[Literal["name", "url", "query", "tags"]] | Omit = omit,
242+
search_by: List[Literal["name", "url", "instructions", "tags"]] | Omit = omit,
243243
search_type: Literal["exact", "prefix"] | Omit = omit,
244244
status: Literal["active", "paused", "failed"] | Omit = omit,
245245
tag: str | Omit = omit,
@@ -261,8 +261,8 @@ def list(
261261
Args:
262262
q: Free-text search term, matched against the fields named in `search_by`.
263263
264-
search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note `query`
265-
only exists on semantic monitors.
264+
search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note
265+
`instructions` only exists on extract monitors.
266266
267267
search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token
268268
matching.
@@ -816,7 +816,7 @@ async def list(
816816
cursor: str | Omit = omit,
817817
limit: int | Omit = omit,
818818
q: str | Omit = omit,
819-
search_by: List[Literal["name", "url", "query", "tags"]] | Omit = omit,
819+
search_by: List[Literal["name", "url", "instructions", "tags"]] | Omit = omit,
820820
search_type: Literal["exact", "prefix"] | Omit = omit,
821821
status: Literal["active", "paused", "failed"] | Omit = omit,
822822
tag: str | Omit = omit,
@@ -838,8 +838,8 @@ async def list(
838838
Args:
839839
q: Free-text search term, matched against the fields named in `search_by`.
840840
841-
search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note `query`
842-
only exists on semantic monitors.
841+
search_by: Comma-separated fields to search with `q`. Defaults to all of them. Note
842+
`instructions` only exists on extract monitors.
843843
844844
search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token
845845
matching.

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

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

6161

6262
class ChangeDetectionMonitorsSemanticChangeDetection(TypedDict, total=False):
63-
"""Detect meaning-level changes that match a natural language query."""
64-
65-
query: Required[str]
63+
"""
64+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
65+
"""
6666

6767
type: Required[Literal["semantic"]]
6868

@@ -128,16 +128,21 @@ class TargetMonitorsSitemapTarget(TypedDict, total=False):
128128
class TargetMonitorsExtractTarget(TypedDict, total=False):
129129
"""Watch a site's extracted structured data."""
130130

131+
instructions: Required[str]
132+
"""Natural-language instructions describing what to extract and watch.
133+
134+
This single prompt scopes both the extraction and what changes get reported:
135+
only data captured by the schema and these instructions is compared between
136+
runs.
137+
"""
138+
131139
type: Required[Literal["extract"]]
132140

133141
url: Required[str]
134142
"""Root URL to extract structured data from."""
135143

136144
follow_subdomains: bool
137145

138-
instructions: str
139-
"""Optional natural-language instructions guiding what to extract."""
140-
141146
max_depth: int
142147
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
143148

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
3838

3939

4040
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
41-
"""Detect meaning-level changes that match a natural language query."""
42-
43-
query: str
41+
"""
42+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
43+
"""
4444

4545
type: Literal["semantic"]
4646

@@ -107,16 +107,21 @@ class TargetMonitorsSitemapTarget(BaseModel):
107107
class TargetMonitorsExtractTarget(BaseModel):
108108
"""Watch a site's extracted structured data."""
109109

110+
instructions: str
111+
"""Natural-language instructions describing what to extract and watch.
112+
113+
This single prompt scopes both the extraction and what changes get reported:
114+
only data captured by the schema and these instructions is compared between
115+
runs.
116+
"""
117+
110118
type: Literal["extract"]
111119

112120
url: str
113121
"""Root URL to extract structured data from."""
114122

115123
follow_subdomains: Optional[bool] = None
116124

117-
instructions: Optional[str] = None
118-
"""Optional natural-language instructions guiding what to extract."""
119-
120125
max_depth: Optional[int] = None
121126
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
122127

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class MonitorListParams(TypedDict, total=False):
2020
q: str
2121
"""Free-text search term, matched against the fields named in `search_by`."""
2222

23-
search_by: List[Literal["name", "url", "query", "tags"]]
23+
search_by: List[Literal["name", "url", "instructions", "tags"]]
2424
"""Comma-separated fields to search with `q`.
2525
26-
Defaults to all of them. Note `query` only exists on semantic monitors.
26+
Defaults to all of them. Note `instructions` only exists on extract monitors.
2727
"""
2828

2929
search_type: Literal["exact", "prefix"]

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class DataChangeDetectionMonitorsExactChangeDetection(BaseModel):
3939

4040

4141
class DataChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
42-
"""Detect meaning-level changes that match a natural language query."""
43-
44-
query: str
42+
"""
43+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
44+
"""
4545

4646
type: Literal["semantic"]
4747

@@ -108,16 +108,21 @@ class DataTargetMonitorsSitemapTarget(BaseModel):
108108
class DataTargetMonitorsExtractTarget(BaseModel):
109109
"""Watch a site's extracted structured data."""
110110

111+
instructions: str
112+
"""Natural-language instructions describing what to extract and watch.
113+
114+
This single prompt scopes both the extraction and what changes get reported:
115+
only data captured by the schema and these instructions is compared between
116+
runs.
117+
"""
118+
111119
type: Literal["extract"]
112120

113121
url: str
114122
"""Root URL to extract structured data from."""
115123

116124
follow_subdomains: Optional[bool] = None
117125

118-
instructions: Optional[str] = None
119-
"""Optional natural-language instructions guiding what to extract."""
120-
121126
max_depth: Optional[int] = None
122127
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
123128

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ class MonitorRetrieveChangeResponse(BaseModel):
7575
matched_urls: Optional[List[str]] = None
7676
"""At most 500 URLs are included; the corresponding count field is always exact."""
7777

78-
query: Optional[str] = None
79-
8078
removed_url_count: Optional[int] = None
8179

8280
removed_urls: Optional[List[str]] = None

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
3838

3939

4040
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
41-
"""Detect meaning-level changes that match a natural language query."""
42-
43-
query: str
41+
"""
42+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
43+
"""
4444

4545
type: Literal["semantic"]
4646

@@ -107,16 +107,21 @@ class TargetMonitorsSitemapTarget(BaseModel):
107107
class TargetMonitorsExtractTarget(BaseModel):
108108
"""Watch a site's extracted structured data."""
109109

110+
instructions: str
111+
"""Natural-language instructions describing what to extract and watch.
112+
113+
This single prompt scopes both the extraction and what changes get reported:
114+
only data captured by the schema and these instructions is compared between
115+
runs.
116+
"""
117+
110118
type: Literal["extract"]
111119

112120
url: str
113121
"""Root URL to extract structured data from."""
114122

115123
follow_subdomains: Optional[bool] = None
116124

117-
instructions: Optional[str] = None
118-
"""Optional natural-language instructions guiding what to extract."""
119-
120125
max_depth: Optional[int] = None
121126
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
122127

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class ChangeDetectionMonitorsExactChangeDetection(TypedDict, total=False):
5656

5757

5858
class ChangeDetectionMonitorsSemanticChangeDetection(TypedDict, total=False):
59-
"""Detect meaning-level changes that match a natural language query."""
60-
61-
query: Required[str]
59+
"""
60+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
61+
"""
6262

6363
type: Required[Literal["semantic"]]
6464

@@ -124,16 +124,21 @@ class TargetMonitorsSitemapTarget(TypedDict, total=False):
124124
class TargetMonitorsExtractTarget(TypedDict, total=False):
125125
"""Watch a site's extracted structured data."""
126126

127+
instructions: Required[str]
128+
"""Natural-language instructions describing what to extract and watch.
129+
130+
This single prompt scopes both the extraction and what changes get reported:
131+
only data captured by the schema and these instructions is compared between
132+
runs.
133+
"""
134+
127135
type: Required[Literal["extract"]]
128136

129137
url: Required[str]
130138
"""Root URL to extract structured data from."""
131139

132140
follow_subdomains: bool
133141

134-
instructions: str
135-
"""Optional natural-language instructions guiding what to extract."""
136-
137142
max_depth: int
138143
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
139144

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class ChangeDetectionMonitorsExactChangeDetection(BaseModel):
3838

3939

4040
class ChangeDetectionMonitorsSemanticChangeDetection(BaseModel):
41-
"""Detect meaning-level changes that match a natural language query."""
42-
43-
query: str
41+
"""
42+
Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
43+
"""
4444

4545
type: Literal["semantic"]
4646

@@ -107,16 +107,21 @@ class TargetMonitorsSitemapTarget(BaseModel):
107107
class TargetMonitorsExtractTarget(BaseModel):
108108
"""Watch a site's extracted structured data."""
109109

110+
instructions: str
111+
"""Natural-language instructions describing what to extract and watch.
112+
113+
This single prompt scopes both the extraction and what changes get reported:
114+
only data captured by the schema and these instructions is compared between
115+
runs.
116+
"""
117+
110118
type: Literal["extract"]
111119

112120
url: str
113121
"""Root URL to extract structured data from."""
114122

115123
follow_subdomains: Optional[bool] = None
116124

117-
instructions: Optional[str] = None
118-
"""Optional natural-language instructions guiding what to extract."""
119-
120125
max_depth: Optional[int] = None
121126
"""Optional maximum link depth from the starting URL (0 = only the starting page)."""
122127

0 commit comments

Comments
 (0)