diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4ad3fef..e756293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.0" + ".": "0.19.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e845d92..8baafcf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e26ac226a3cf6d02380f3df386077414dd424dbf35c7c40e02ba512eff1dff84.yml -openapi_spec_hash: 077166ff05843544fbb4b519200ac9fc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-18e7692e180f911962f33787228afa2cf31f6c05ab23c6afb1ca4f82b108fba5.yml +openapi_spec_hash: 865bd1e346267d1e33f8ca63963c6aa3 config_hash: 70354330f92ce169beabc98696ebb9a3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1576fe0..5f9a131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.19.0 (2026-05-09) + +Full Changelog: [v0.18.0...v0.19.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.18.0...v0.19.0) + +### Features + +* **api:** api update ([9706153](https://github.com/context-dot-dev/context-python-sdk/commit/97061533bf1bfebbba56574529b4cd2f69863edc)) + ## 0.18.0 (2026-05-07) Full Changelog: [v0.17.0...v0.18.0](https://github.com/context-dot-dev/context-python-sdk/compare/v0.17.0...v0.18.0) diff --git a/pyproject.toml b/pyproject.toml index fd4511a..4bb887a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "context.dev" -version = "0.18.0" +version = "0.19.0" description = "The official Python library for the context.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/context/dev/_version.py b/src/context/dev/_version.py index 84297f6..4028ca7 100644 --- a/src/context/dev/_version.py +++ b/src/context/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "context.dev" -__version__ = "0.18.0" # x-release-please-version +__version__ = "0.19.0" # x-release-please-version diff --git a/src/context/dev/resources/web.py b/src/context/dev/resources/web.py index 43538ca..92cabf5 100644 --- a/src/context/dev/resources/web.py +++ b/src/context/dev/resources/web.py @@ -182,9 +182,9 @@ def screenshot( full_screenshot: Literal["true", "false"] | Omit = omit, max_age_ms: int | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, - prioritize: Literal["speed", "quality"] | Omit = omit, timeout_ms: int | Omit = omit, viewport: web_screenshot_params.Viewport | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -218,16 +218,16 @@ def screenshot( provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'. - prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - faster capture with basic quality. If 'quality', optimizes for higher quality - with longer wait times. Defaults to 'quality' if not provided. - timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). viewport: Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. + wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking + the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + omitted. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,9 +250,9 @@ def screenshot( "full_screenshot": full_screenshot, "max_age_ms": max_age_ms, "page": page, - "prioritize": prioritize, "timeout_ms": timeout_ms, "viewport": viewport, + "wait_for_ms": wait_for_ms, }, web_screenshot_params.WebScreenshotParams, ), @@ -276,6 +276,7 @@ def web_crawl_md( timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, use_main_content_only: bool | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -324,6 +325,9 @@ def web_crawl_md( use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and navigation + wait_for_ms: Optional browser wait time in milliseconds after initial page load for each + crawled page. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -349,6 +353,7 @@ def web_crawl_md( "timeout_ms": timeout_ms, "url_regex": url_regex, "use_main_content_only": use_main_content_only, + "wait_for_ms": wait_for_ms, }, web_web_crawl_md_params.WebWebCrawlMdParams, ), @@ -366,6 +371,7 @@ def web_scrape_html( max_age_ms: int | Omit = omit, parse_pdf: bool | Omit = omit, timeout_ms: int | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -393,6 +399,10 @@ def web_scrape_html( than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). + wait_for_ms: + Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -415,6 +425,7 @@ def web_scrape_html( "max_age_ms": max_age_ms, "parse_pdf": parse_pdf, "timeout_ms": timeout_ms, + "wait_for_ms": wait_for_ms, }, web_web_scrape_html_params.WebWebScrapeHTMLParams, ), @@ -429,6 +440,7 @@ def web_scrape_images( enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, max_age_ms: int | Omit = omit, timeout_ms: int | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -455,6 +467,9 @@ def web_scrape_images( than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). + wait_for_ms: Optional browser wait time in milliseconds after initial page load before + collecting images. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -476,6 +491,7 @@ def web_scrape_images( "enrichment": enrichment, "max_age_ms": max_age_ms, "timeout_ms": timeout_ms, + "wait_for_ms": wait_for_ms, }, web_web_scrape_images_params.WebWebScrapeImagesParams, ), @@ -495,6 +511,7 @@ def web_scrape_md( shorten_base64_images: bool | Omit = omit, timeout_ms: int | Omit = omit, use_main_content_only: bool | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -532,6 +549,9 @@ def web_scrape_md( use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars, and navigation + wait_for_ms: Optional browser wait time in milliseconds after initial page load before + converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -558,6 +578,7 @@ def web_scrape_md( "shorten_base64_images": shorten_base64_images, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, + "wait_for_ms": wait_for_ms, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), @@ -767,9 +788,9 @@ async def screenshot( full_screenshot: Literal["true", "false"] | Omit = omit, max_age_ms: int | Omit = omit, page: Literal["login", "signup", "blog", "careers", "pricing", "terms", "privacy", "contact"] | Omit = omit, - prioritize: Literal["speed", "quality"] | Omit = omit, timeout_ms: int | Omit = omit, viewport: web_screenshot_params.Viewport | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -803,16 +824,16 @@ async def screenshot( provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'. - prioritize: Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - faster capture with basic quality. If 'quality', optimizes for higher quality - with longer wait times. Defaults to 'quality' if not provided. - timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). viewport: Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. + wait_for_ms: Optional browser wait time in milliseconds after initial page load before taking + the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + omitted. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -835,9 +856,9 @@ async def screenshot( "full_screenshot": full_screenshot, "max_age_ms": max_age_ms, "page": page, - "prioritize": prioritize, "timeout_ms": timeout_ms, "viewport": viewport, + "wait_for_ms": wait_for_ms, }, web_screenshot_params.WebScreenshotParams, ), @@ -861,6 +882,7 @@ async def web_crawl_md( timeout_ms: int | Omit = omit, url_regex: str | Omit = omit, use_main_content_only: bool | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -909,6 +931,9 @@ async def web_crawl_md( use_main_content_only: Extract only the main content, stripping headers, footers, sidebars, and navigation + wait_for_ms: Optional browser wait time in milliseconds after initial page load for each + crawled page. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -934,6 +959,7 @@ async def web_crawl_md( "timeout_ms": timeout_ms, "url_regex": url_regex, "use_main_content_only": use_main_content_only, + "wait_for_ms": wait_for_ms, }, web_web_crawl_md_params.WebWebCrawlMdParams, ), @@ -951,6 +977,7 @@ async def web_scrape_html( max_age_ms: int | Omit = omit, parse_pdf: bool | Omit = omit, timeout_ms: int | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -978,6 +1005,10 @@ async def web_scrape_html( than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). + wait_for_ms: + Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1000,6 +1031,7 @@ async def web_scrape_html( "max_age_ms": max_age_ms, "parse_pdf": parse_pdf, "timeout_ms": timeout_ms, + "wait_for_ms": wait_for_ms, }, web_web_scrape_html_params.WebWebScrapeHTMLParams, ), @@ -1014,6 +1046,7 @@ async def web_scrape_images( enrichment: web_web_scrape_images_params.Enrichment | Omit = omit, max_age_ms: int | Omit = omit, timeout_ms: int | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1040,6 +1073,9 @@ async def web_scrape_images( than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). + wait_for_ms: Optional browser wait time in milliseconds after initial page load before + collecting images. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1061,6 +1097,7 @@ async def web_scrape_images( "enrichment": enrichment, "max_age_ms": max_age_ms, "timeout_ms": timeout_ms, + "wait_for_ms": wait_for_ms, }, web_web_scrape_images_params.WebWebScrapeImagesParams, ), @@ -1080,6 +1117,7 @@ async def web_scrape_md( shorten_base64_images: bool | Omit = omit, timeout_ms: int | Omit = omit, use_main_content_only: bool | Omit = omit, + wait_for_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1117,6 +1155,9 @@ async def web_scrape_md( use_main_content_only: Extract only the main content of the page, excluding headers, footers, sidebars, and navigation + wait_for_ms: Optional browser wait time in milliseconds after initial page load before + converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1143,6 +1184,7 @@ async def web_scrape_md( "shorten_base64_images": shorten_base64_images, "timeout_ms": timeout_ms, "use_main_content_only": use_main_content_only, + "wait_for_ms": wait_for_ms, }, web_web_scrape_md_params.WebWebScrapeMdParams, ), diff --git a/src/context/dev/types/web_screenshot_params.py b/src/context/dev/types/web_screenshot_params.py index e901dd6..04b0909 100644 --- a/src/context/dev/types/web_screenshot_params.py +++ b/src/context/dev/types/web_screenshot_params.py @@ -47,14 +47,6 @@ class WebScreenshotParams(TypedDict, total=False): applicable when using 'domain', not 'directUrl'. """ - prioritize: Literal["speed", "quality"] - """Optional parameter to prioritize screenshot capture. - - If 'speed', optimizes for faster capture with basic quality. If 'quality', - optimizes for higher quality with longer wait times. Defaults to 'quality' if - not provided. - """ - timeout_ms: Annotated[int, PropertyInfo(alias="timeoutMS")] """Optional timeout in milliseconds for the request. @@ -65,6 +57,13 @@ class WebScreenshotParams(TypedDict, total=False): viewport: Viewport """Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.""" + wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + """ + Optional browser wait time in milliseconds after initial page load before taking + the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + omitted. + """ + class Viewport(TypedDict, total=False): """Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.""" diff --git a/src/context/dev/types/web_web_crawl_md_params.py b/src/context/dev/types/web_web_crawl_md_params.py index bbc71a5..dfd4fec 100644 --- a/src/context/dev/types/web_web_crawl_md_params.py +++ b/src/context/dev/types/web_web_crawl_md_params.py @@ -70,3 +70,9 @@ class WebWebCrawlMdParams(TypedDict, total=False): Extract only the main content, stripping headers, footers, sidebars, and navigation """ + + wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + """ + Optional browser wait time in milliseconds after initial page load for each + crawled page. Min: 0. Max: 30000 (30 seconds). + """ diff --git a/src/context/dev/types/web_web_scrape_html_params.py b/src/context/dev/types/web_web_scrape_html_params.py index 6f28cf9..8f04cd3 100644 --- a/src/context/dev/types/web_web_scrape_html_params.py +++ b/src/context/dev/types/web_web_scrape_html_params.py @@ -36,3 +36,9 @@ class WebWebScrapeHTMLParams(TypedDict, total=False): If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). """ + + wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + """Optional browser wait time in milliseconds after initial page load. + + Min: 0. Max: 30000 (30 seconds). + """ diff --git a/src/context/dev/types/web_web_scrape_images_params.py b/src/context/dev/types/web_web_scrape_images_params.py index 189ea2b..ef6713d 100644 --- a/src/context/dev/types/web_web_scrape_images_params.py +++ b/src/context/dev/types/web_web_scrape_images_params.py @@ -33,6 +33,12 @@ class WebWebScrapeImagesParams(TypedDict, total=False): status code. Maximum allowed value is 300000ms (5 minutes). """ + wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + """ + Optional browser wait time in milliseconds after initial page load before + collecting images. Min: 0. Max: 30000 (30 seconds). + """ + class Enrichment(TypedDict, total=False): """ diff --git a/src/context/dev/types/web_web_scrape_md_params.py b/src/context/dev/types/web_web_scrape_md_params.py index e65c18f..0908d6c 100644 --- a/src/context/dev/types/web_web_scrape_md_params.py +++ b/src/context/dev/types/web_web_scrape_md_params.py @@ -54,3 +54,9 @@ class WebWebScrapeMdParams(TypedDict, total=False): Extract only the main content of the page, excluding headers, footers, sidebars, and navigation """ + + wait_for_ms: Annotated[int, PropertyInfo(alias="waitForMs")] + """ + Optional browser wait time in milliseconds after initial page load before + converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + """ diff --git a/tests/api_resources/test_web.py b/tests/api_resources/test_web.py index 0b2f2f4..933c939 100644 --- a/tests/api_resources/test_web.py +++ b/tests/api_resources/test_web.py @@ -117,12 +117,12 @@ def test_method_screenshot_with_all_params(self, client: ContextDev) -> None: full_screenshot="true", max_age_ms=0, page="login", - prioritize="speed", timeout_ms=1000, viewport={ "height": 240, "width": 240, }, + wait_for_ms=0, ) assert_matches_type(WebScreenshotResponse, web, path=["response"]) @@ -173,6 +173,7 @@ def test_method_web_crawl_md_with_all_params(self, client: ContextDev) -> None: timeout_ms=1000, url_regex="^https?://[^/]+/blog/", use_main_content_only=True, + wait_for_ms=0, ) assert_matches_type(WebWebCrawlMdResponse, web, path=["response"]) @@ -219,6 +220,7 @@ def test_method_web_scrape_html_with_all_params(self, client: ContextDev) -> Non max_age_ms=0, parse_pdf=True, timeout_ms=1000, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeHTMLResponse, web, path=["response"]) @@ -269,6 +271,7 @@ def test_method_web_scrape_images_with_all_params(self, client: ContextDev) -> N }, max_age_ms=0, timeout_ms=1000, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeImagesResponse, web, path=["response"]) @@ -319,6 +322,7 @@ def test_method_web_scrape_md_with_all_params(self, client: ContextDev) -> None: shorten_base64_images=True, timeout_ms=1000, use_main_content_only=True, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"]) @@ -490,12 +494,12 @@ async def test_method_screenshot_with_all_params(self, async_client: AsyncContex full_screenshot="true", max_age_ms=0, page="login", - prioritize="speed", timeout_ms=1000, viewport={ "height": 240, "width": 240, }, + wait_for_ms=0, ) assert_matches_type(WebScreenshotResponse, web, path=["response"]) @@ -546,6 +550,7 @@ async def test_method_web_crawl_md_with_all_params(self, async_client: AsyncCont timeout_ms=1000, url_regex="^https?://[^/]+/blog/", use_main_content_only=True, + wait_for_ms=0, ) assert_matches_type(WebWebCrawlMdResponse, web, path=["response"]) @@ -592,6 +597,7 @@ async def test_method_web_scrape_html_with_all_params(self, async_client: AsyncC max_age_ms=0, parse_pdf=True, timeout_ms=1000, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeHTMLResponse, web, path=["response"]) @@ -642,6 +648,7 @@ async def test_method_web_scrape_images_with_all_params(self, async_client: Asyn }, max_age_ms=0, timeout_ms=1000, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeImagesResponse, web, path=["response"]) @@ -692,6 +699,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncCon shorten_base64_images=True, timeout_ms=1000, use_main_content_only=True, + wait_for_ms=0, ) assert_matches_type(WebWebScrapeMdResponse, web, path=["response"])