diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eb4e0dba..caf14871 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.0" + ".": "1.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 192797ac..f40d1167 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-466614a040e7f31307530bd6ba443e714b6303eaa141904e7d32e6641d5ec55f.yml -openapi_spec_hash: 2d06680e7c17847e4fbcac35124d2456 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-b2831c9c836f039762834825afdc20569587a825d29ac5c3748c78b009bf059b.yml +openapi_spec_hash: dd85a934900cb6583f12ebf6117be884 config_hash: 40fbac80e24faaa0dc19e93368bcd821 diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4cadc0..859bfcce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 1.11.0 (2026-05-20) + +Full Changelog: [v1.10.0...v1.11.0](https://github.com/browserbase/sdk-python/compare/v1.10.0...v1.11.0) + +### Features + +* [AI-1748][apps/api] Obtain custom certificates in API during session reservation ([9c0b78d](https://github.com/browserbase/sdk-python/commit/9c0b78d40adf9e9e2f49a2dbb34e37aa622b8991)) +* [AI-1972] - Move fetch v2 handler into /v1/fetch ([de76605](https://github.com/browserbase/sdk-python/commit/de766051f87c90c307b93f0614b2df48fd4d4ee9)) +* [AI-1993] - Surface structured JSON content on /v2/fetch ([97f1c02](https://github.com/browserbase/sdk-python/commit/97f1c02a520d433abe467b11a04f7fbab85fd3f3)) +* **api:** manual updates ([1d7beb8](https://github.com/browserbase/sdk-python/commit/1d7beb84745bd33ae11c9948a4f057f8240467a0)) +* **api:** manual updates ([23a3a2f](https://github.com/browserbase/sdk-python/commit/23a3a2f0d156d438b0c9aa1430663dc51f49f11e)) + ## 1.10.0 (2026-05-13) Full Changelog: [v1.9.0...v1.10.0](https://github.com/browserbase/sdk-python/compare/v1.9.0...v1.10.0) diff --git a/pyproject.toml b/pyproject.toml index 404289b8..3338ab43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "browserbase" -version = "1.10.0" +version = "1.11.0" description = "The official Python library for the Browserbase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/browserbase/_version.py b/src/browserbase/_version.py index c811ccc9..1184ad60 100644 --- a/src/browserbase/_version.py +++ b/src/browserbase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "browserbase" -__version__ = "1.10.0" # x-release-please-version +__version__ = "1.11.0" # x-release-please-version diff --git a/src/browserbase/resources/fetch_api.py b/src/browserbase/resources/fetch_api.py index dc016722..fc23ac33 100644 --- a/src/browserbase/resources/fetch_api.py +++ b/src/browserbase/resources/fetch_api.py @@ -2,6 +2,9 @@ from __future__ import annotations +from typing import Dict +from typing_extensions import Literal + import httpx from ..types import fetch_api_create_params @@ -47,7 +50,9 @@ def create( url: str, allow_insecure_ssl: bool | Omit = omit, allow_redirects: bool | Omit = omit, + format: Literal["raw", "json", "markdown"] | Omit = omit, proxies: bool | Omit = omit, + schema: Dict[str, object] | 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, @@ -65,8 +70,15 @@ def create( allow_redirects: Whether to follow HTTP redirects + format: Output format for the response content. `raw` (default) returns the response + body unchanged; `json` returns structured data (requires `schema`); `markdown` + returns the page as markdown. + proxies: Whether to enable proxy support for the request + schema: JSON Schema describing the desired structure of the response. Only used when + `format` is `json`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -82,7 +94,9 @@ def create( "url": url, "allow_insecure_ssl": allow_insecure_ssl, "allow_redirects": allow_redirects, + "format": format, "proxies": proxies, + "schema": schema, }, fetch_api_create_params.FetchAPICreateParams, ), @@ -119,7 +133,9 @@ async def create( url: str, allow_insecure_ssl: bool | Omit = omit, allow_redirects: bool | Omit = omit, + format: Literal["raw", "json", "markdown"] | Omit = omit, proxies: bool | Omit = omit, + schema: Dict[str, object] | 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, @@ -137,8 +153,15 @@ async def create( allow_redirects: Whether to follow HTTP redirects + format: Output format for the response content. `raw` (default) returns the response + body unchanged; `json` returns structured data (requires `schema`); `markdown` + returns the page as markdown. + proxies: Whether to enable proxy support for the request + schema: JSON Schema describing the desired structure of the response. Only used when + `format` is `json`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -154,7 +177,9 @@ async def create( "url": url, "allow_insecure_ssl": allow_insecure_ssl, "allow_redirects": allow_redirects, + "format": format, "proxies": proxies, + "schema": schema, }, fetch_api_create_params.FetchAPICreateParams, ), diff --git a/src/browserbase/types/fetch_api_create_params.py b/src/browserbase/types/fetch_api_create_params.py index 84a8a052..f83096f7 100644 --- a/src/browserbase/types/fetch_api_create_params.py +++ b/src/browserbase/types/fetch_api_create_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict +from typing_extensions import Literal, Required, Annotated, TypedDict from .._utils import PropertyInfo @@ -19,5 +20,18 @@ class FetchAPICreateParams(TypedDict, total=False): allow_redirects: Annotated[bool, PropertyInfo(alias="allowRedirects")] """Whether to follow HTTP redirects""" + format: Literal["raw", "json", "markdown"] + """Output format for the response content. + + `raw` (default) returns the response body unchanged; `json` returns structured + data (requires `schema`); `markdown` returns the page as markdown. + """ + proxies: bool """Whether to enable proxy support for the request""" + + schema: Dict[str, object] + """JSON Schema describing the desired structure of the response. + + Only used when `format` is `json`. + """ diff --git a/src/browserbase/types/fetch_api_create_response.py b/src/browserbase/types/fetch_api_create_response.py index f97f5635..6a378000 100644 --- a/src/browserbase/types/fetch_api_create_response.py +++ b/src/browserbase/types/fetch_api_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict +from typing import Dict, Union from pydantic import Field as FieldInfo @@ -13,8 +13,12 @@ class FetchAPICreateResponse(BaseModel): id: str """Unique identifier for the fetch request""" - content: str - """The response body content""" + content: Union[str, Dict[str, object]] + """The response body content. + + A string for `raw` and `markdown` formats; a structured object for `json` format + (the schema-extracted result). + """ content_type: str = FieldInfo(alias="contentType") """The MIME type of the response""" diff --git a/tests/api_resources/test_fetch_api.py b/tests/api_resources/test_fetch_api.py index b9a0455b..def3304d 100644 --- a/tests/api_resources/test_fetch_api.py +++ b/tests/api_resources/test_fetch_api.py @@ -30,7 +30,9 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None: url="https://example.com", allow_insecure_ssl=True, allow_redirects=True, + format="raw", proxies=True, + schema={"foo": "bar"}, ) assert_matches_type(FetchAPICreateResponse, fetch_api, path=["response"]) @@ -77,7 +79,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas url="https://example.com", allow_insecure_ssl=True, allow_redirects=True, + format="raw", proxies=True, + schema={"foo": "bar"}, ) assert_matches_type(FetchAPICreateResponse, fetch_api, path=["response"])