From ebb2283beb1651cf679774e4cfe45e652118f0e8 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Sun, 27 Oct 2024 05:11:08 +0000 Subject: [PATCH 1/7] feat: various codegen changes --- examples/e2e/test_playwright.py | 2 -- examples/playwright_captcha.py | 1 + examples/playwright_contexts.py | 2 ++ examples/playwright_downloads.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/e2e/test_playwright.py b/examples/e2e/test_playwright.py index 725d47b1..a08de603 100644 --- a/examples/e2e/test_playwright.py +++ b/examples/e2e/test_playwright.py @@ -4,7 +4,6 @@ import pytest from dotenv import load_dotenv from playwright.sync_api import Playwright, sync_playwright - from browserbase import Browserbase from .. import ( @@ -28,7 +27,6 @@ def playwright() -> Generator[Playwright, None, None]: with sync_playwright() as p: yield p - def test_playwright_basic(playwright: Playwright) -> None: playwright_basic.run(playwright) diff --git a/examples/playwright_captcha.py b/examples/playwright_captcha.py index a5f0b431..da768447 100644 --- a/examples/playwright_captcha.py +++ b/examples/playwright_captcha.py @@ -1,5 +1,6 @@ from playwright.sync_api import Playwright, ConsoleMessage, sync_playwright + from examples import ( BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, diff --git a/examples/playwright_contexts.py b/examples/playwright_contexts.py index 6776a088..6a10846d 100644 --- a/examples/playwright_contexts.py +++ b/examples/playwright_contexts.py @@ -3,6 +3,7 @@ from playwright.sync_api import Cookie, Browser, Playwright, sync_playwright + from examples import ( BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, @@ -14,6 +15,7 @@ BrowserSettingsContext, ) + CONTEXT_TEST_URL = "https://www.browserbase.com" SECOND = 1000 diff --git a/examples/playwright_downloads.py b/examples/playwright_downloads.py index bded0cff..3e1e3401 100644 --- a/examples/playwright_downloads.py +++ b/examples/playwright_downloads.py @@ -4,6 +4,7 @@ from playwright.sync_api import Playwright, sync_playwright + from examples import ( BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, From 1f3a1896fb45f077e50070c02b5ba4810c819cae Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 01:14:35 +0000 Subject: [PATCH 2/7] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3d4a375d..743dc513 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b37d85811d1ccbd73a7884f22792503aa7e3103d378c97c84028b8b3b79acddc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3140ed9942ce873c477c950cc9a13ccce88c3b054b903cdf78ac0db6cf2c634f.yml From 3050f628fde93180fe9f5bd6c6d6eac511a2624c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:18:34 +0000 Subject: [PATCH 3/7] feat(api): update via SDK Studio (#27) --- .stats.yml | 2 +- src/browserbase/resources/sessions/sessions.py | 10 ---------- src/browserbase/types/session_create_params.py | 6 ------ tests/api_resources/test_sessions.py | 2 -- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 743dc513..b004f1be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3140ed9942ce873c477c950cc9a13ccce88c3b054b903cdf78ac0db6cf2c634f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-1ccf843d2efab92c6fa01ffb11a0b5e6787218d750597687de526ac9f22f6b81.yml diff --git a/src/browserbase/resources/sessions/sessions.py b/src/browserbase/resources/sessions/sessions.py index 74a99bbb..0bdb3e9a 100644 --- a/src/browserbase/resources/sessions/sessions.py +++ b/src/browserbase/resources/sessions/sessions.py @@ -106,7 +106,6 @@ def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, - api_timeout: int | NotGiven = NOT_GIVEN, # 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, @@ -133,9 +132,6 @@ def create( region: The region where the Session should run. - api_timeout: Duration in seconds after which the session will automatically end. Defaults to - the Project's `defaultTimeout`. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -154,7 +150,6 @@ def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, - "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), @@ -360,7 +355,6 @@ async def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, - api_timeout: int | NotGiven = NOT_GIVEN, # 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, @@ -387,9 +381,6 @@ async def create( region: The region where the Session should run. - api_timeout: Duration in seconds after which the session will automatically end. Defaults to - the Project's `defaultTimeout`. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -408,7 +399,6 @@ async def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, - "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), diff --git a/src/browserbase/types/session_create_params.py b/src/browserbase/types/session_create_params.py index 3b1920a8..9b8d3b1e 100644 --- a/src/browserbase/types/session_create_params.py +++ b/src/browserbase/types/session_create_params.py @@ -47,12 +47,6 @@ class SessionCreateParams(TypedDict, total=False): region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] """The region where the Session should run.""" - api_timeout: Annotated[int, PropertyInfo(alias="timeout")] - """Duration in seconds after which the session will automatically end. - - Defaults to the Project's `defaultTimeout`. - """ - class BrowserSettingsContext(TypedDict, total=False): id: Required[str] diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index dadadd46..81c0f79f 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -65,7 +65,6 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None: keep_alive=True, proxies={}, region="us-west-2", - api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) @@ -294,7 +293,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas keep_alive=True, proxies={}, region="us-west-2", - api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) From b5f5482f57e27d38af4ac550845d5484f870bf39 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:19:34 +0000 Subject: [PATCH 4/7] feat(api): update via SDK Studio (#28) --- .stats.yml | 2 +- src/browserbase/resources/sessions/sessions.py | 10 ++++++++++ src/browserbase/types/session_create_params.py | 6 ++++++ tests/api_resources/test_sessions.py | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b004f1be..743dc513 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-1ccf843d2efab92c6fa01ffb11a0b5e6787218d750597687de526ac9f22f6b81.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3140ed9942ce873c477c950cc9a13ccce88c3b054b903cdf78ac0db6cf2c634f.yml diff --git a/src/browserbase/resources/sessions/sessions.py b/src/browserbase/resources/sessions/sessions.py index 0bdb3e9a..74a99bbb 100644 --- a/src/browserbase/resources/sessions/sessions.py +++ b/src/browserbase/resources/sessions/sessions.py @@ -106,6 +106,7 @@ def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, + api_timeout: int | NotGiven = NOT_GIVEN, # 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, @@ -132,6 +133,9 @@ def create( region: The region where the Session should run. + api_timeout: Duration in seconds after which the session will automatically end. Defaults to + the Project's `defaultTimeout`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,6 +154,7 @@ def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, + "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), @@ -355,6 +360,7 @@ async def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, + api_timeout: int | NotGiven = NOT_GIVEN, # 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, @@ -381,6 +387,9 @@ async def create( region: The region where the Session should run. + api_timeout: Duration in seconds after which the session will automatically end. Defaults to + the Project's `defaultTimeout`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -399,6 +408,7 @@ async def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, + "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), diff --git a/src/browserbase/types/session_create_params.py b/src/browserbase/types/session_create_params.py index 9b8d3b1e..3b1920a8 100644 --- a/src/browserbase/types/session_create_params.py +++ b/src/browserbase/types/session_create_params.py @@ -47,6 +47,12 @@ class SessionCreateParams(TypedDict, total=False): region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] """The region where the Session should run.""" + api_timeout: Annotated[int, PropertyInfo(alias="timeout")] + """Duration in seconds after which the session will automatically end. + + Defaults to the Project's `defaultTimeout`. + """ + class BrowserSettingsContext(TypedDict, total=False): id: Required[str] diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index 81c0f79f..dadadd46 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -65,6 +65,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None: keep_alive=True, proxies={}, region="us-west-2", + api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) @@ -293,6 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas keep_alive=True, proxies={}, region="us-west-2", + api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) From dfef96cfe0d79804a6351b35836a41ea42f35703 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 01:29:01 +0000 Subject: [PATCH 5/7] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 743dc513..70bdddeb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3140ed9942ce873c477c950cc9a13ccce88c3b054b903cdf78ac0db6cf2c634f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-60444f8b1aa1aa8dbec1e9f11e929c2b7ac27470764ef5f1796134fc27f3381c.yml From fc40b62e7dbe6af78e429cb1d4cc090f3cf75286 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:34:02 +0000 Subject: [PATCH 6/7] feat(api): update via SDK Studio (#29) --- src/browserbase/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browserbase/_client.py b/src/browserbase/_client.py index b0d011bb..df49eed2 100644 --- a/src/browserbase/_client.py +++ b/src/browserbase/_client.py @@ -94,7 +94,7 @@ def __init__( if base_url is None: base_url = os.environ.get("BROWSERBASE_BASE_URL") if base_url is None: - base_url = f"https://www.browserbase.com" + base_url = f"https://api.dev.browserbase.com" super().__init__( version=__version__, @@ -268,7 +268,7 @@ def __init__( if base_url is None: base_url = os.environ.get("BROWSERBASE_BASE_URL") if base_url is None: - base_url = f"https://www.browserbase.com" + base_url = f"https://api.dev.browserbase.com" super().__init__( version=__version__, From 6f1674464fe6ea8e8228f0f9fd3f59b73829cbc1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 01:34:21 +0000 Subject: [PATCH 7/7] release: 0.1.0-alpha.5 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ pyproject.toml | 2 +- src/browserbase/_version.py | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b56c3d0b..e8285b71 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.4" + ".": "0.1.0-alpha.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c057cbb..8cb679ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.1.0-alpha.5 (2024-10-28) + +Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/browserbase/sdk-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) + +### Features + +* **api:** update via SDK Studio ([#27](https://github.com/browserbase/sdk-python/issues/27)) ([3050f62](https://github.com/browserbase/sdk-python/commit/3050f628fde93180fe9f5bd6c6d6eac511a2624c)) +* **api:** update via SDK Studio ([#28](https://github.com/browserbase/sdk-python/issues/28)) ([b5f5482](https://github.com/browserbase/sdk-python/commit/b5f5482f57e27d38af4ac550845d5484f870bf39)) +* **api:** update via SDK Studio ([#29](https://github.com/browserbase/sdk-python/issues/29)) ([fc40b62](https://github.com/browserbase/sdk-python/commit/fc40b62e7dbe6af78e429cb1d4cc090f3cf75286)) +* various codegen changes ([ebb2283](https://github.com/browserbase/sdk-python/commit/ebb2283beb1651cf679774e4cfe45e652118f0e8)) + ## 0.1.0-alpha.4 (2024-10-27) Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/browserbase/sdk-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4) diff --git a/pyproject.toml b/pyproject.toml index 67b0716d..cb341e0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "browserbase" -version = "0.1.0-alpha.4" +version = "0.1.0-alpha.5" 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 17196336..1dd5a80e 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__ = "0.1.0-alpha.4" # x-release-please-version +__version__ = "0.1.0-alpha.5" # x-release-please-version