Skip to content

Commit da261be

Browse files
feat(api): api update
1 parent 3688eab commit da261be

7 files changed

Lines changed: 34 additions & 54 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: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-21a0195dcea548066fd6c227d634217b897900a6732a688e41c83344c2e92c94.yml
3-
openapi_spec_hash: 388f5780dc9bf205c04b6a6214e4fafc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-758c3a2fbd5b7be61c8e6e0ad2e6a5ec30695747bb675960d888c497647d13d7.yml
3+
openapi_spec_hash: 00002d90bde02f67e174368ae470c597
44
config_hash: 2bea1743c84d63bd61f8501a6ea63065

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ def retrieve(
5858
extra_body: Body | None = None,
5959
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6060
) -> BatchRetrieveResponse:
61-
"""Check progress and get download links when the batch finishes.
62-
63-
Also returns the
64-
rejected-URL list from submission. The webhook signing secret is not repeated
65-
here — it is returned once, by the submit response.
61+
"""
62+
Check progress, and get download links once the batch finishes.
6663
6764
Args:
6865
batch_id: ID of the batch to retrieve or cancel.
@@ -202,9 +199,8 @@ def get_results(
202199
timeout: float | httpx.Timeout | None | NotGiven = not_given,
203200
) -> BatchGetResultsResponse:
204201
"""
205-
Page through the result records of a finished batch as JSON, in the same order
206-
as the downloadable result files. Use this instead of downloading and parsing
207-
the NDJSON files yourself.
202+
Page through a finished batch's results as JSON instead of downloading the
203+
NDJSON files.
208204
209205
Args:
210206
batch_id: ID of the batch to retrieve or cancel.
@@ -323,11 +319,8 @@ async def retrieve(
323319
extra_body: Body | None = None,
324320
timeout: float | httpx.Timeout | None | NotGiven = not_given,
325321
) -> BatchRetrieveResponse:
326-
"""Check progress and get download links when the batch finishes.
327-
328-
Also returns the
329-
rejected-URL list from submission. The webhook signing secret is not repeated
330-
here — it is returned once, by the submit response.
322+
"""
323+
Check progress, and get download links once the batch finishes.
331324
332325
Args:
333326
batch_id: ID of the batch to retrieve or cancel.
@@ -467,9 +460,8 @@ async def get_results(
467460
timeout: float | httpx.Timeout | None | NotGiven = not_given,
468461
) -> BatchGetResultsResponse:
469462
"""
470-
Page through the result records of a finished batch as JSON, in the same order
471-
as the downloadable result files. Use this instead of downloading and parsing
472-
the NDJSON files yourself.
463+
Page through a finished batch's results as JSON instead of downloading the
464+
NDJSON files.
473465
474466
Args:
475467
batch_id: ID of the batch to retrieve or cancel.

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

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,8 @@ def screenshot(
620620
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
621621
'light' or 'dark' when the site offers both appearances.
622622
623-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
624-
residential proxy exit location. Must be one of Context.dev's supported
625-
countries. When provided, Context.dev fetches the target page from that country.
623+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
624+
alpha-2).
626625
627626
direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g.,
628627
'https://example.com/pricing'). When provided, the screenshot is taken of this
@@ -1280,9 +1279,8 @@ def web_crawl_md(
12801279
Args:
12811280
url: The starting URL for the crawl (must include http:// or https:// protocol)
12821281
1283-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
1284-
residential proxy exit location. Must be one of Context.dev's supported
1285-
countries. When provided, Context.dev fetches the target page from that country.
1282+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
1283+
alpha-2).
12861284
12871285
exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
12881286
Applied after includeSelectors. Exclusion takes precedence: an element matching
@@ -1630,9 +1628,8 @@ def web_scrape_html(
16301628
content is captured. Requires a paid plan. Send a JSON array in the query
16311629
parameter. Maximum: 5 actions.
16321630
1633-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
1634-
residential proxy exit location. Must be one of Context.dev's supported
1635-
countries. When provided, Context.dev fetches the target page from that country.
1631+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
1632+
alpha-2).
16361633
16371634
exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
16381635
Exclusion takes precedence: an element matching both is removed. Examples:
@@ -2071,9 +2068,8 @@ def web_scrape_md(
20712068
content is captured. Requires a paid plan. Send a JSON array in the query
20722069
parameter. Maximum: 5 actions.
20732070
2074-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
2075-
residential proxy exit location. Must be one of Context.dev's supported
2076-
countries. When provided, Context.dev fetches the target page from that country.
2071+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
2072+
alpha-2).
20772073
20782074
exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
20792075
includeSelectors. Exclusion takes precedence: an element matching both is
@@ -2824,9 +2820,8 @@ async def screenshot(
28242820
color_scheme: Optional parameter to choose the site's visual theme in the screenshot. Use
28252821
'light' or 'dark' when the site offers both appearances.
28262822
2827-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
2828-
residential proxy exit location. Must be one of Context.dev's supported
2829-
countries. When provided, Context.dev fetches the target page from that country.
2823+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
2824+
alpha-2).
28302825
28312826
direct_url: A specific URL to screenshot directly, bypassing domain resolution (e.g.,
28322827
'https://example.com/pricing'). When provided, the screenshot is taken of this
@@ -3484,9 +3479,8 @@ async def web_crawl_md(
34843479
Args:
34853480
url: The starting URL for the crawl (must include http:// or https:// protocol)
34863481
3487-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
3488-
residential proxy exit location. Must be one of Context.dev's supported
3489-
countries. When provided, Context.dev fetches the target page from that country.
3482+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
3483+
alpha-2).
34903484
34913485
exclude_selectors: CSS selectors to remove before each crawled page is converted to Markdown.
34923486
Applied after includeSelectors. Exclusion takes precedence: an element matching
@@ -3834,9 +3828,8 @@ async def web_scrape_html(
38343828
content is captured. Requires a paid plan. Send a JSON array in the query
38353829
parameter. Maximum: 5 actions.
38363830
3837-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
3838-
residential proxy exit location. Must be one of Context.dev's supported
3839-
countries. When provided, Context.dev fetches the target page from that country.
3831+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
3832+
alpha-2).
38403833
38413834
exclude_selectors: CSS selectors to remove from the result. Applied after includeSelectors.
38423835
Exclusion takes precedence: an element matching both is removed. Examples:
@@ -4275,9 +4268,8 @@ async def web_scrape_md(
42754268
content is captured. Requires a paid plan. Send a JSON array in the query
42764269
parameter. Maximum: 5 actions.
42774270
4278-
country: Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
4279-
residential proxy exit location. Must be one of Context.dev's supported
4280-
countries. When provided, Context.dev fetches the target page from that country.
4271+
country: Fetch the target page through a residential proxy in this country (ISO 3166-1
4272+
alpha-2).
42814273
42824274
exclude_selectors: CSS selectors to remove before conversion to Markdown. Applied after
42834275
includeSelectors. Exclusion takes precedence: an element matching both is

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,8 @@ class WebScreenshotParams(TypedDict, total=False):
225225
"zw",
226226
]
227227
"""
228-
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
229-
residential proxy exit location. Must be one of Context.dev's supported
230-
countries. When provided, Context.dev fetches the target page from that country.
228+
Fetch the target page through a residential proxy in this country (ISO 3166-1
229+
alpha-2).
231230
"""
232231

233232
direct_url: Annotated[str, PropertyInfo(alias="directUrl")]

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,8 @@ class WebWebCrawlMdParams(TypedDict, total=False):
221221
"zw",
222222
]
223223
"""
224-
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
225-
residential proxy exit location. Must be one of Context.dev's supported
226-
countries. When provided, Context.dev fetches the target page from that country.
224+
Fetch the target page through a residential proxy in this country (ISO 3166-1
225+
alpha-2).
227226
"""
228227

229228
exclude_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludeSelectors")]

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
229229
"zw",
230230
]
231231
"""
232-
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
233-
residential proxy exit location. Must be one of Context.dev's supported
234-
countries. When provided, Context.dev fetches the target page from that country.
232+
Fetch the target page through a residential proxy in this country (ISO 3166-1
233+
alpha-2).
235234
"""
236235

237236
exclude_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="excludeSelectors")]

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,8 @@ class WebWebScrapeMdParams(TypedDict, total=False):
232232
"zw",
233233
]
234234
"""
235-
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
236-
residential proxy exit location. Must be one of Context.dev's supported
237-
countries. When provided, Context.dev fetches the target page from that country.
235+
Fetch the target page through a residential proxy in this country (ISO 3166-1
236+
alpha-2).
238237
"""
239238

240239
exclude_selectors: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="excludeSelectors")]

0 commit comments

Comments
 (0)