Skip to content

Commit 3649236

Browse files
feat(api): api update
1 parent 0784f70 commit 3649236

12 files changed

Lines changed: 152 additions & 17 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d880c25aee159e1260e23dfa3685b1bb9e35b02a1927adecbff32664ba8e11a4.yml
3-
openapi_spec_hash: aa96a6030390bca0b4cdfa2363961807
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e26ac226a3cf6d02380f3df386077414dd424dbf35c7c40e02ba512eff1dff84.yml
3+
openapi_spec_hash: 077166ff05843544fbb4b519200ac9fc
44
config_hash: 70354330f92ce169beabc98696ebb9a3

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ def extract_product(
126126
younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
127127
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
128128
129-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
130-
300000ms (5 minutes).
129+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
130+
than this value, it will be aborted with a 408 status code. Maximum allowed
131+
value is 300000ms (5 minutes).
131132
132133
extra_headers: Send extra headers
133134
@@ -183,8 +184,9 @@ def extract_products(
183184
184185
max_products: Maximum number of products to extract.
185186
186-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
187-
300000ms (5 minutes).
187+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
188+
than this value, it will be aborted with a 408 status code. Maximum allowed
189+
value is 300000ms (5 minutes).
188190
189191
extra_headers: Send extra headers
190192
@@ -227,8 +229,9 @@ def extract_products(
227229
228230
max_products: Maximum number of products to extract.
229231
230-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
231-
300000ms (5 minutes).
232+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
233+
than this value, it will be aborted with a 408 status code. Maximum allowed
234+
value is 300000ms (5 minutes).
232235
233236
extra_headers: Send extra headers
234237
@@ -375,8 +378,9 @@ async def extract_product(
375378
younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
376379
omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
377380
378-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
379-
300000ms (5 minutes).
381+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
382+
than this value, it will be aborted with a 408 status code. Maximum allowed
383+
value is 300000ms (5 minutes).
380384
381385
extra_headers: Send extra headers
382386
@@ -432,8 +436,9 @@ async def extract_products(
432436
433437
max_products: Maximum number of products to extract.
434438
435-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
436-
300000ms (5 minutes).
439+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
440+
than this value, it will be aborted with a 408 status code. Maximum allowed
441+
value is 300000ms (5 minutes).
437442
438443
extra_headers: Send extra headers
439444
@@ -476,8 +481,9 @@ async def extract_products(
476481
477482
max_products: Maximum number of products to extract.
478483
479-
timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is
480-
300000ms (5 minutes).
484+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
485+
than this value, it will be aborted with a 408 status code. Maximum allowed
486+
value is 300000ms (5 minutes).
481487
482488
extra_headers: Send extra headers
483489

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

Lines changed: 72 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ class AIExtractProductParams(TypedDict, total=False):
2323
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
2424
"""Optional timeout in milliseconds for the request.
2525
26-
Maximum allowed value is 300000ms (5 minutes).
26+
If the request takes longer than this value, it will be aborted with a 408
27+
status code. Maximum allowed value is 300000ms (5 minutes).
2728
"""

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class ByDomain(TypedDict, total=False):
2727
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
2828
"""Optional timeout in milliseconds for the request.
2929
30-
Maximum allowed value is 300000ms (5 minutes).
30+
If the request takes longer than this value, it will be aborted with a 408
31+
status code. Maximum allowed value is 300000ms (5 minutes).
3132
"""
3233

3334

@@ -51,7 +52,8 @@ class ByDirectURL(TypedDict, total=False):
5152
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
5253
"""Optional timeout in milliseconds for the request.
5354
54-
Maximum allowed value is 300000ms (5 minutes).
55+
If the request takes longer than this value, it will be aborted with a 408
56+
status code. Maximum allowed value is 300000ms (5 minutes).
5557
"""
5658

5759

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ class WebScreenshotParams(TypedDict, total=False):
5555
not provided.
5656
"""
5757

58+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
59+
"""Optional timeout in milliseconds for the request.
60+
61+
If the request takes longer than this value, it will be aborted with a 408
62+
status code. Maximum allowed value is 300000ms (5 minutes).
63+
"""
64+
5865
viewport: Viewport
5966
"""Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080."""
6067

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ class WebWebCrawlMdParams(TypedDict, total=False):
5555
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
5656
"""Truncate base64-encoded image data in the Markdown output"""
5757

58+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
59+
"""Optional timeout in milliseconds for the request.
60+
61+
If the request takes longer than this value, it will be aborted with a 408
62+
status code. Maximum allowed value is 300000ms (5 minutes).
63+
"""
64+
5865
url_regex: Annotated[str, PropertyInfo(alias="urlRegex")]
5966
"""Regex pattern. Only URLs matching this pattern will be followed and scraped."""
6067

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ class WebWebScrapeHTMLParams(TypedDict, total=False):
2929
returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
3030
and a 400 WEBSITE_ACCESS_ERROR is returned.
3131
"""
32+
33+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
34+
"""Optional timeout in milliseconds for the request.
35+
36+
If the request takes longer than this value, it will be aborted with a 408
37+
status code. Maximum allowed value is 300000ms (5 minutes).
38+
"""

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ class WebWebScrapeImagesParams(TypedDict, total=False):
2626
days).
2727
"""
2828

29+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
30+
"""Optional timeout in milliseconds for the request.
31+
32+
If the request takes longer than this value, it will be aborted with a 408
33+
status code. Maximum allowed value is 300000ms (5 minutes).
34+
"""
35+
2936

3037
class Enrichment(TypedDict, total=False):
3138
"""

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ class WebWebScrapeMdParams(TypedDict, total=False):
4242
shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")]
4343
"""Shorten base64-encoded image data in the Markdown output"""
4444

45+
timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")]
46+
"""Optional timeout in milliseconds for the request.
47+
48+
If the request takes longer than this value, it will be aborted with a 408
49+
status code. Maximum allowed value is 300000ms (5 minutes).
50+
"""
51+
4552
use_main_content_only: Annotated[bool, PropertyInfo(alias="useMainContentOnly")]
4653
"""
4754
Extract only the main content of the page, excluding headers, footers, sidebars,

0 commit comments

Comments
 (0)