Skip to content

Commit d95d38f

Browse files
author
stlc-bot
committed
feat(scrape): align timeout options and public SDK methods (#1207)
Stainless-Generated-From: 34def0b117bff91e2c1a65cae2573d1859e1c5b3
1 parent 71ad00b commit d95d38f

40 files changed

Lines changed: 1900 additions & 10936 deletions

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 51
1+
configured_endpoints: 43

‎api.md‎

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,70 +17,38 @@ Types:
1717
```python
1818
from context.dev.types import (
1919
WebAnswersResponse,
20-
WebExtractResponse,
2120
WebExtractCompetitorsResponse,
22-
WebExtractFontsResponse,
2321
WebExtractStyleguideResponse,
22+
WebMapURLsResponse,
2423
WebScrapeResponse,
2524
WebScreenshotResponse,
2625
WebSearchResponse,
2726
WebWebCrawlMdResponse,
28-
WebWebScrapeBytesResponse,
29-
WebWebScrapeHTMLResponse,
30-
WebWebScrapeImagesResponse,
31-
WebWebScrapeMdResponse,
32-
WebWebScrapeScreenshotResponse,
33-
WebWebScrapeSitemapResponse,
3427
)
3528
```
3629

3730
Methods:
3831

3932
- <code title="post /web/answers">client.web.<a href="./src/context/dev/resources/web.py">answers</a>(\*\*<a href="src/context/dev/types/web_answers_params.py">params</a>) -> <a href="./src/context/dev/types/web_answers_response.py">WebAnswersResponse</a></code>
40-
- <code title="post /web/extract">client.web.<a href="./src/context/dev/resources/web.py">extract</a>(\*\*<a href="src/context/dev/types/web_extract_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_response.py">WebExtractResponse</a></code>
4133
- <code title="get /web/competitors">client.web.<a href="./src/context/dev/resources/web.py">extract_competitors</a>(\*\*<a href="src/context/dev/types/web_extract_competitors_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_competitors_response.py">WebExtractCompetitorsResponse</a></code>
42-
- <code title="get /web/fonts">client.web.<a href="./src/context/dev/resources/web.py">extract_fonts</a>(\*\*<a href="src/context/dev/types/web_extract_fonts_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_fonts_response.py">WebExtractFontsResponse</a></code>
4334
- <code title="get /web/styleguide">client.web.<a href="./src/context/dev/resources/web.py">extract_styleguide</a>(\*\*<a href="src/context/dev/types/web_extract_styleguide_params.py">params</a>) -> <a href="./src/context/dev/types/web_extract_styleguide_response.py">WebExtractStyleguideResponse</a></code>
35+
- <code title="get /web/urls">client.web.<a href="./src/context/dev/resources/web.py">map_urls</a>(\*\*<a href="src/context/dev/types/web_map_urls_params.py">params</a>) -> <a href="./src/context/dev/types/web_map_urls_response.py">WebMapURLsResponse</a></code>
4436
- <code title="post /web/scrape">client.web.<a href="./src/context/dev/resources/web.py">scrape</a>(\*\*<a href="src/context/dev/types/web_scrape_params.py">params</a>) -> <a href="./src/context/dev/types/web_scrape_response.py">WebScrapeResponse</a></code>
4537
- <code title="get /web/screenshot">client.web.<a href="./src/context/dev/resources/web.py">screenshot</a>(\*\*<a href="src/context/dev/types/web_screenshot_params.py">params</a>) -> <a href="./src/context/dev/types/web_screenshot_response.py">WebScreenshotResponse</a></code>
4638
- <code title="post /web/search">client.web.<a href="./src/context/dev/resources/web.py">search</a>(\*\*<a href="src/context/dev/types/web_search_params.py">params</a>) -> <a href="./src/context/dev/types/web_search_response.py">WebSearchResponse</a></code>
4739
- <code title="post /web/crawl">client.web.<a href="./src/context/dev/resources/web.py">web_crawl_md</a>(\*\*<a href="src/context/dev/types/web_web_crawl_md_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_crawl_md_response.py">WebWebCrawlMdResponse</a></code>
48-
- <code title="get /web/scrape/bytes">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_bytes</a>(\*\*<a href="src/context/dev/types/web_web_scrape_bytes_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_bytes_response.py">WebWebScrapeBytesResponse</a></code>
49-
- <code title="get /web/scrape/html">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_html</a>(\*\*<a href="src/context/dev/types/web_web_scrape_html_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_html_response.py">WebWebScrapeHTMLResponse</a></code>
50-
- <code title="get /web/scrape/images">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_images</a>(\*\*<a href="src/context/dev/types/web_web_scrape_images_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_images_response.py">WebWebScrapeImagesResponse</a></code>
51-
- <code title="get /web/scrape/markdown">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_md</a>(\*\*<a href="src/context/dev/types/web_web_scrape_md_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_md_response.py">WebWebScrapeMdResponse</a></code>
52-
- <code title="get /web/scrape/screenshot">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_screenshot</a>(\*\*<a href="src/context/dev/types/web_web_scrape_screenshot_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_screenshot_response.py">WebWebScrapeScreenshotResponse</a></code>
53-
- <code title="get /web/scrape/sitemap">client.web.<a href="./src/context/dev/resources/web.py">web_scrape_sitemap</a>(\*\*<a href="src/context/dev/types/web_web_scrape_sitemap_params.py">params</a>) -> <a href="./src/context/dev/types/web_web_scrape_sitemap_response.py">WebWebScrapeSitemapResponse</a></code>
54-
55-
# AI
56-
57-
Types:
58-
59-
```python
60-
from context.dev.types import AIExtractProductResponse, AIExtractProductsResponse
61-
```
62-
63-
Methods:
64-
65-
- <code title="post /brand/ai/product">client.ai.<a href="./src/context/dev/resources/ai.py">extract_product</a>(\*\*<a href="src/context/dev/types/ai_extract_product_params.py">params</a>) -> <a href="./src/context/dev/types/ai_extract_product_response.py">AIExtractProductResponse</a></code>
66-
- <code title="post /brand/ai/products">client.ai.<a href="./src/context/dev/resources/ai.py">extract_products</a>(\*\*<a href="src/context/dev/types/ai_extract_products_params.py">params</a>) -> <a href="./src/context/dev/types/ai_extract_products_response.py">AIExtractProductsResponse</a></code>
6740

6841
# Brand
6942

7043
Types:
7144

7245
```python
73-
from context.dev.types import (
74-
BrandRetrieveResponse,
75-
BrandRetrieveSimplifiedResponse,
76-
BrandSearchResponse,
77-
)
46+
from context.dev.types import BrandRetrieveResponse, BrandSearchResponse
7847
```
7948

8049
Methods:
8150

8251
- <code title="post /brand/retrieve">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/context/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
83-
- <code title="get /brand/retrieve-simplified">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_simplified</a>(\*\*<a href="src/context/dev/types/brand_retrieve_simplified_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_simplified_response.py">BrandRetrieveSimplifiedResponse</a></code>
8452
- <code title="get /brand/search">client.brand.<a href="./src/context/dev/resources/brand.py">search</a>(\*\*<a href="src/context/dev/types/brand_search_params.py">params</a>) -> <a href="./src/context/dev/types/brand_search_response.py">BrandSearchResponse</a></code>
8553

8654
# Industry
@@ -127,6 +95,8 @@ from context.dev.types import (
12795
MonitorListChangesResponse,
12896
MonitorListRunsResponse,
12997
MonitorRetrieveChangeResponse,
98+
MonitorRetrieveRunResponse,
99+
MonitorRotateWebhookSecretResponse,
130100
MonitorRunResponse,
131101
)
132102
```
@@ -145,6 +115,8 @@ Methods:
145115
- <code title="get /monitors/{monitor_id}/changes">client.monitors.<a href="./src/context/dev/resources/monitors.py">list_changes</a>(monitor_id, \*\*<a href="src/context/dev/types/monitor_list_changes_params.py">params</a>) -> <a href="./src/context/dev/types/monitor_list_changes_response.py">MonitorListChangesResponse</a></code>
146116
- <code title="get /monitors/{monitor_id}/runs">client.monitors.<a href="./src/context/dev/resources/monitors.py">list_runs</a>(monitor_id, \*\*<a href="src/context/dev/types/monitor_list_runs_params.py">params</a>) -> <a href="./src/context/dev/types/monitor_list_runs_response.py">MonitorListRunsResponse</a></code>
147117
- <code title="get /monitors/changes/{change_id}">client.monitors.<a href="./src/context/dev/resources/monitors.py">retrieve_change</a>(change_id) -> <a href="./src/context/dev/types/monitor_retrieve_change_response.py">MonitorRetrieveChangeResponse</a></code>
118+
- <code title="get /monitors/{monitor_id}/runs/{run_id}">client.monitors.<a href="./src/context/dev/resources/monitors.py">retrieve_run</a>(run_id, \*, monitor_id) -> <a href="./src/context/dev/types/monitor_retrieve_run_response.py">MonitorRetrieveRunResponse</a></code>
119+
- <code title="post /monitors/{monitor_id}/webhook/rotate-secret">client.monitors.<a href="./src/context/dev/resources/monitors.py">rotate_webhook_secret</a>(monitor_id) -> <a href="./src/context/dev/types/monitor_rotate_webhook_secret_response.py">MonitorRotateWebhookSecretResponse</a></code>
148120
- <code title="post /monitors/{monitor_id}/run">client.monitors.<a href="./src/context/dev/resources/monitors.py">run</a>(monitor_id) -> <a href="./src/context/dev/types/monitor_run_response.py">MonitorRunResponse</a></code>
149121

150122
# Batch

‎src/context/dev/_client.py‎

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
)
3636

3737
if TYPE_CHECKING:
38-
from .resources import ai, web, logs, news, batch, brand, parse, people, utility, industry, monitors, webhooks
39-
from .resources.ai import AIResource, AsyncAIResource
38+
from .resources import web, logs, news, batch, brand, parse, people, utility, industry, monitors, webhooks
4039
from .resources.web import WebResource, AsyncWebResource
4140
from .resources.logs import LogsResource, AsyncLogsResource
4241
from .resources.news import NewsResource, AsyncNewsResource
@@ -137,12 +136,6 @@ def web(self) -> WebResource:
137136

138137
return WebResource(self)
139138

140-
@cached_property
141-
def ai(self) -> AIResource:
142-
from .resources.ai import AIResource
143-
144-
return AIResource(self)
145-
146139
@cached_property
147140
def brand(self) -> BrandResource:
148141
from .resources.brand import BrandResource
@@ -395,12 +388,6 @@ def web(self) -> AsyncWebResource:
395388

396389
return AsyncWebResource(self)
397390

398-
@cached_property
399-
def ai(self) -> AsyncAIResource:
400-
from .resources.ai import AsyncAIResource
401-
402-
return AsyncAIResource(self)
403-
404391
@cached_property
405392
def brand(self) -> AsyncBrandResource:
406393
from .resources.brand import AsyncBrandResource
@@ -595,12 +582,6 @@ def web(self) -> web.WebResourceWithRawResponse:
595582

596583
return WebResourceWithRawResponse(self._client.web)
597584

598-
@cached_property
599-
def ai(self) -> ai.AIResourceWithRawResponse:
600-
from .resources.ai import AIResourceWithRawResponse
601-
602-
return AIResourceWithRawResponse(self._client.ai)
603-
604585
@cached_property
605586
def brand(self) -> brand.BrandResourceWithRawResponse:
606587
from .resources.brand import BrandResourceWithRawResponse
@@ -683,12 +664,6 @@ def web(self) -> web.AsyncWebResourceWithRawResponse:
683664

684665
return AsyncWebResourceWithRawResponse(self._client.web)
685666

686-
@cached_property
687-
def ai(self) -> ai.AsyncAIResourceWithRawResponse:
688-
from .resources.ai import AsyncAIResourceWithRawResponse
689-
690-
return AsyncAIResourceWithRawResponse(self._client.ai)
691-
692667
@cached_property
693668
def brand(self) -> brand.AsyncBrandResourceWithRawResponse:
694669
from .resources.brand import AsyncBrandResourceWithRawResponse
@@ -771,12 +746,6 @@ def web(self) -> web.WebResourceWithStreamingResponse:
771746

772747
return WebResourceWithStreamingResponse(self._client.web)
773748

774-
@cached_property
775-
def ai(self) -> ai.AIResourceWithStreamingResponse:
776-
from .resources.ai import AIResourceWithStreamingResponse
777-
778-
return AIResourceWithStreamingResponse(self._client.ai)
779-
780749
@cached_property
781750
def brand(self) -> brand.BrandResourceWithStreamingResponse:
782751
from .resources.brand import BrandResourceWithStreamingResponse
@@ -859,12 +828,6 @@ def web(self) -> web.AsyncWebResourceWithStreamingResponse:
859828

860829
return AsyncWebResourceWithStreamingResponse(self._client.web)
861830

862-
@cached_property
863-
def ai(self) -> ai.AsyncAIResourceWithStreamingResponse:
864-
from .resources.ai import AsyncAIResourceWithStreamingResponse
865-
866-
return AsyncAIResourceWithStreamingResponse(self._client.ai)
867-
868831
@cached_property
869832
def brand(self) -> brand.AsyncBrandResourceWithStreamingResponse:
870833
from .resources.brand import AsyncBrandResourceWithStreamingResponse

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from .ai import (
4-
AIResource,
5-
AsyncAIResource,
6-
AIResourceWithRawResponse,
7-
AsyncAIResourceWithRawResponse,
8-
AIResourceWithStreamingResponse,
9-
AsyncAIResourceWithStreamingResponse,
10-
)
113
from .web import (
124
WebResource,
135
AsyncWebResource,
@@ -110,12 +102,6 @@
110102
"AsyncWebResourceWithRawResponse",
111103
"WebResourceWithStreamingResponse",
112104
"AsyncWebResourceWithStreamingResponse",
113-
"AIResource",
114-
"AsyncAIResource",
115-
"AIResourceWithRawResponse",
116-
"AsyncAIResourceWithRawResponse",
117-
"AIResourceWithStreamingResponse",
118-
"AsyncAIResourceWithStreamingResponse",
119105
"BrandResource",
120106
"AsyncBrandResource",
121107
"BrandResourceWithRawResponse",

0 commit comments

Comments
 (0)