Skip to content

Commit 0f2daf3

Browse files
authored
Merge pull request #40 from browserbase/release-please--branches--main--changes--next
release: 1.0.0-alpha.0
2 parents ac33a02 + ec7b6c4 commit 0f2daf3

File tree

10 files changed

+82
-21
lines changed

10 files changed

+82
-21
lines changed

Diff for: .release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.7"
2+
".": "1.0.0-alpha.0"
33
}

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-9f93c744538f57747ea1385817e21b40c318b65ebc155dca8950268beb280bc9.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b341dd9d5bb77c4f217b94b186763e730fd798fbb773a5e90bb4e2a8d4a2c822.yml

Diff for: CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 1.0.0-alpha.0 (2024-10-29)
4+
5+
Full Changelog: [v0.1.0-alpha.7...v1.0.0-alpha.0](https://github.com/browserbase/sdk-python/compare/v0.1.0-alpha.7...v1.0.0-alpha.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#39](https://github.com/browserbase/sdk-python/issues/39)) ([8c98d9e](https://github.com/browserbase/sdk-python/commit/8c98d9e9da61daba527262aa1b0a1334da22a596))
10+
* **api:** api update ([#41](https://github.com/browserbase/sdk-python/issues/41)) ([0557ee5](https://github.com/browserbase/sdk-python/commit/0557ee507fc35faa9aabd8d06ce8047bb07843aa))
11+
312
## 0.1.0-alpha.7 (2024-10-28)
413

514
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/browserbase/sdk-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)

Diff for: README.md

-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ bb = Browserbase(
4141

4242
session = client.sessions.create(
4343
project_id=BROWSERBASE_PROJECT_ID,
44-
proxies=True,
4544
)
4645
print(session.id)
4746

@@ -113,7 +112,6 @@ client = Browserbase()
113112
try:
114113
client.sessions.create(
115114
project_id="your_project_id",
116-
proxies=True,
117115
)
118116
except browserbase.APIConnectionError as e:
119117
print("The server could not be reached")
@@ -159,7 +157,6 @@ client = Browserbase(
159157
# Or, configure per-request:
160158
client.with_options(max_retries=5).sessions.create(
161159
project_id="your_project_id",
162-
proxies=True,
163160
)
164161
```
165162

@@ -185,7 +182,6 @@ client = Browserbase(
185182
# Override per-request:
186183
client.with_options(timeout=5.0).sessions.create(
187184
project_id="your_project_id",
188-
proxies=True,
189185
)
190186
```
191187

@@ -227,7 +223,6 @@ from browserbase import Browserbase
227223
client = Browserbase()
228224
response = client.sessions.with_raw_response.create(
229225
project_id="your_project_id",
230-
proxies=True,
231226
)
232227
print(response.headers.get('X-My-Header'))
233228

@@ -248,7 +243,6 @@ To stream the response body, use `.with_streaming_response` instead, which requi
248243
```python
249244
with client.sessions.with_streaming_response.create(
250245
project_id="your_project_id",
251-
proxies=True,
252246
) as response:
253247
print(response.headers.get("X-My-Header"))
254248

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "browserbase"
3-
version = "0.1.0-alpha.7"
3+
version = "1.0.0-alpha.0"
44
description = "The official Python library for the Browserbase API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

Diff for: src/browserbase/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "browserbase"
4-
__version__ = "0.1.0-alpha.7" # x-release-please-version
4+
__version__ = "1.0.0-alpha.0" # x-release-please-version

Diff for: src/browserbase/resources/sessions/sessions.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Union, Iterable
56
from typing_extensions import Literal
67

78
import httpx
@@ -104,7 +105,7 @@ def create(
104105
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
105106
extension_id: str | NotGiven = NOT_GIVEN,
106107
keep_alive: bool | NotGiven = NOT_GIVEN,
107-
proxies: object | NotGiven = NOT_GIVEN,
108+
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
108109
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
109110
api_timeout: int | NotGiven = NOT_GIVEN,
110111
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -358,7 +359,7 @@ async def create(
358359
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
359360
extension_id: str | NotGiven = NOT_GIVEN,
360361
keep_alive: bool | NotGiven = NOT_GIVEN,
361-
proxies: object | NotGiven = NOT_GIVEN,
362+
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
362363
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
363364
api_timeout: int | NotGiven = NOT_GIVEN,
364365
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

Diff for: src/browserbase/types/session_create_params.py

+60-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import List
6-
from typing_extensions import Literal, Required, Annotated, TypedDict
5+
from typing import List, Union, Iterable
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._utils import PropertyInfo
99

@@ -14,6 +14,10 @@
1414
"BrowserSettingsFingerprint",
1515
"BrowserSettingsFingerprintScreen",
1616
"BrowserSettingsViewport",
17+
"ProxiesUnionMember1",
18+
"ProxiesUnionMember1BrowserbaseProxyConfig",
19+
"ProxiesUnionMember1BrowserbaseProxyConfigGeolocation",
20+
"ProxiesUnionMember1ExternalProxyConfig",
1721
]
1822

1923

@@ -38,7 +42,7 @@ class SessionCreateParams(TypedDict, total=False):
3842
This is available on the Startup plan only.
3943
"""
4044

41-
proxies: object
45+
proxies: Union[bool, Iterable[ProxiesUnionMember1]]
4246
"""Proxy configuration.
4347
4448
Can be true for default proxy, or an array of proxy configurations.
@@ -130,3 +134,56 @@ class BrowserSettings(TypedDict, total=False):
130134
"""Enable or disable captcha solving in the browser. Defaults to `true`."""
131135

132136
viewport: BrowserSettingsViewport
137+
138+
139+
class ProxiesUnionMember1BrowserbaseProxyConfigGeolocation(TypedDict, total=False):
140+
country: Required[str]
141+
"""Country code in ISO 3166-1 alpha-2 format"""
142+
143+
city: str
144+
"""Name of the city. Use spaces for multi-word city names. Optional."""
145+
146+
state: str
147+
"""US state code (2 characters). Must also specify US as the country. Optional."""
148+
149+
150+
class ProxiesUnionMember1BrowserbaseProxyConfig(TypedDict, total=False):
151+
type: Required[Literal["browserbase"]]
152+
"""Type of proxy.
153+
154+
Always use 'browserbase' for the Browserbase managed proxy network.
155+
"""
156+
157+
domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
158+
"""Domain pattern for which this proxy should be used.
159+
160+
If omitted, defaults to all domains. Optional.
161+
"""
162+
163+
geolocation: ProxiesUnionMember1BrowserbaseProxyConfigGeolocation
164+
"""Configuration for geolocation"""
165+
166+
167+
class ProxiesUnionMember1ExternalProxyConfig(TypedDict, total=False):
168+
server: Required[str]
169+
"""Server URL for external proxy. Required."""
170+
171+
type: Required[Literal["external"]]
172+
"""Type of proxy. Always 'external' for this config."""
173+
174+
domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
175+
"""Domain pattern for which this proxy should be used.
176+
177+
If omitted, defaults to all domains. Optional.
178+
"""
179+
180+
password: str
181+
"""Password for external proxy authentication. Optional."""
182+
183+
username: str
184+
"""Username for external proxy authentication. Optional."""
185+
186+
187+
ProxiesUnionMember1: TypeAlias = Union[
188+
ProxiesUnionMember1BrowserbaseProxyConfig, ProxiesUnionMember1ExternalProxyConfig
189+
]

Diff for: tests/api_resources/test_sessions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None:
6363
},
6464
extension_id="extensionId",
6565
keep_alive=True,
66-
proxies={},
66+
proxies=True,
6767
region="us-west-2",
6868
api_timeout=60,
6969
)
@@ -292,7 +292,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas
292292
},
293293
extension_id="extensionId",
294294
keep_alive=True,
295-
proxies={},
295+
proxies=True,
296296
region="us-west-2",
297297
api_timeout=60,
298298
)

Diff for: tests/test_client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
723723
with pytest.raises(APITimeoutError):
724724
self.client.post(
725725
"/v1/sessions",
726-
body=cast(object, dict(project_id="your_project_id", proxies=True)),
726+
body=cast(object, dict(project_id="your_project_id")),
727727
cast_to=httpx.Response,
728728
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
729729
)
@@ -738,7 +738,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
738738
with pytest.raises(APIStatusError):
739739
self.client.post(
740740
"/v1/sessions",
741-
body=cast(object, dict(project_id="your_project_id", proxies=True)),
741+
body=cast(object, dict(project_id="your_project_id")),
742742
cast_to=httpx.Response,
743743
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
744744
)
@@ -1503,7 +1503,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
15031503
with pytest.raises(APITimeoutError):
15041504
await self.client.post(
15051505
"/v1/sessions",
1506-
body=cast(object, dict(project_id="your_project_id", proxies=True)),
1506+
body=cast(object, dict(project_id="your_project_id")),
15071507
cast_to=httpx.Response,
15081508
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
15091509
)
@@ -1518,7 +1518,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
15181518
with pytest.raises(APIStatusError):
15191519
await self.client.post(
15201520
"/v1/sessions",
1521-
body=cast(object, dict(project_id="your_project_id", proxies=True)),
1521+
body=cast(object, dict(project_id="your_project_id")),
15221522
cast_to=httpx.Response,
15231523
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
15241524
)

0 commit comments

Comments
 (0)