Skip to content

Commit 7d04401

Browse files
release: 1.3.0 (#122)
* chore(internal): update client tests (#121) * fix: asyncify on non-asyncio runtimes (#123) * chore(internal): codegen related update (#124) * feat(client): allow passing `NotGiven` for body (#125) fix(client): mark some request bodies as optional * chore(internal): fix devcontainers setup (#126) * chore(internal): properly set __pydantic_private__ (#127) * docs: update URLs from stainlessapi.com to stainless.com (#128) More details at https://www.stainless.com/changelog/stainless-com * chore(docs): update client docstring (#129) * chore(internal): remove unused http client options forwarding (#130) * feat(api): api update (#131) * chore(internal): codegen related update (#132) * feat(api): api update (#133) * chore(internal): remove extra empty newlines (#134) * chore(internal): bump rye to 0.44.0 (#136) * fix(types): handle more discriminated union shapes (#137) * fix(ci): ensure pip is always available (#138) * fix(ci): remove publishing patch (#139) * codegen metadata * feat(api): api update (#140) * feat(api): api update (#141) * chore: fix typos (#142) * codegen metadata * feat(api): api update (#143) * chore(internal): remove trailing character (#145) * chore(internal): slight transform perf improvement (#147) * chore: slight wording improvement in README (#148) * chore(internal): expand CI branch coverage * chore(internal): reduce CI branch coverage * fix(perf): skip traversing types for NotGiven values * fix(perf): optimize some hot paths * chore(internal): update pyright settings * chore(client): minor internal fixes * release: 1.3.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 797daee commit 7d04401

30 files changed

+380
-154
lines changed

.devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
6+
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
77
ENV PATH=/home/vscode/.rye/shims:$PATH
88

9-
RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
9+
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
}
2525
}
2626
}
27+
},
28+
"features": {
29+
"ghcr.io/devcontainers/features/node:1": {}
2730
}
2831

2932
// Features to add to the dev container. More info: https://containers.dev/features.

.github/workflows/ci.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
lint:
1313
name: lint
1414
runs-on: ubuntu-latest
15-
1615
steps:
1716
- uses: actions/checkout@v4
1817

@@ -21,7 +20,7 @@ jobs:
2120
curl -sSf https://rye.astral.sh/get | bash
2221
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2322
env:
24-
RYE_VERSION: '0.35.0'
23+
RYE_VERSION: '0.44.0'
2524
RYE_INSTALL_OPTION: '--yes'
2625

2726
- name: Install dependencies
@@ -33,7 +32,6 @@ jobs:
3332
test:
3433
name: test
3534
runs-on: ubuntu-latest
36-
3735
steps:
3836
- uses: actions/checkout@v4
3937

@@ -42,7 +40,7 @@ jobs:
4240
curl -sSf https://rye.astral.sh/get | bash
4341
echo "$HOME/.rye/shims" >> $GITHUB_PATH
4442
env:
45-
RYE_VERSION: '0.35.0'
43+
RYE_VERSION: '0.44.0'
4644
RYE_INSTALL_OPTION: '--yes'
4745

4846
- name: Bootstrap

.github/workflows/publish-pypi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
curl -sSf https://rye.astral.sh/get | bash
2222
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2323
env:
24-
RYE_VERSION: '0.35.0'
24+
RYE_VERSION: '0.44.0'
2525
RYE_INSTALL_OPTION: '--yes'
2626

2727
- name: Publish to PyPI

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.2.0"
2+
".": "1.3.0"
33
}

.stats.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-396a2b9092f645c5a9e46a1f3be8c2e45ca9ae079e1d39761eb0a73f56e24b15.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-45328621800082e652c9b2f34b176b89ebba3af423ea9f4fed91a359cf4e0ae4.yml
3+
openapi_spec_hash: c20658b49312b14d158ce5c88f34ee34
4+
config_hash: 74882e23a455dece33e43a27e67f0fbb

CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
# Changelog
22

3+
## 1.3.0 (2025-04-15)
4+
5+
Full Changelog: [v1.2.0...v1.3.0](https://github.com/browserbase/sdk-python/compare/v1.2.0...v1.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#131](https://github.com/browserbase/sdk-python/issues/131)) ([1be828d](https://github.com/browserbase/sdk-python/commit/1be828d5c83e48af8740886303f73620bc71b1ba))
10+
* **api:** api update ([#133](https://github.com/browserbase/sdk-python/issues/133)) ([2a08d98](https://github.com/browserbase/sdk-python/commit/2a08d98914d26cdc36d080bccebd66786b5247ff))
11+
* **api:** api update ([#140](https://github.com/browserbase/sdk-python/issues/140)) ([134049e](https://github.com/browserbase/sdk-python/commit/134049e29ba480a2238a08c327070bda96b05109))
12+
* **api:** api update ([#141](https://github.com/browserbase/sdk-python/issues/141)) ([145e5cb](https://github.com/browserbase/sdk-python/commit/145e5cbfc76ac2731b1d6eb3c069cba59a9fbcd9))
13+
* **api:** api update ([#143](https://github.com/browserbase/sdk-python/issues/143)) ([d55e411](https://github.com/browserbase/sdk-python/commit/d55e4118972d7badbe09a2dd46257d2e66822b85))
14+
* **client:** allow passing `NotGiven` for body ([#125](https://github.com/browserbase/sdk-python/issues/125)) ([6cdee1b](https://github.com/browserbase/sdk-python/commit/6cdee1ba5775d3c72e0cbd9fe757a1b7452780bd))
15+
16+
17+
### Bug Fixes
18+
19+
* asyncify on non-asyncio runtimes ([#123](https://github.com/browserbase/sdk-python/issues/123)) ([c8b2cd7](https://github.com/browserbase/sdk-python/commit/c8b2cd77f4cb07d06a00a09cac3eaa55cf6c6925))
20+
* **ci:** ensure pip is always available ([#138](https://github.com/browserbase/sdk-python/issues/138)) ([173fdde](https://github.com/browserbase/sdk-python/commit/173fddeea8867f93428bddc5ab1d9e1fcd5a925e))
21+
* **ci:** remove publishing patch ([#139](https://github.com/browserbase/sdk-python/issues/139)) ([bd66d56](https://github.com/browserbase/sdk-python/commit/bd66d56eec53a7778ca624a7ccd00fcf8a9f69af))
22+
* **client:** mark some request bodies as optional ([6cdee1b](https://github.com/browserbase/sdk-python/commit/6cdee1ba5775d3c72e0cbd9fe757a1b7452780bd))
23+
* **perf:** optimize some hot paths ([042f048](https://github.com/browserbase/sdk-python/commit/042f048847634ed606d475a0aaeedc5fd129ddbd))
24+
* **perf:** skip traversing types for NotGiven values ([5cc6c58](https://github.com/browserbase/sdk-python/commit/5cc6c58561556e2b50fccbeed5e123adf3aba72d))
25+
* **types:** handle more discriminated union shapes ([#137](https://github.com/browserbase/sdk-python/issues/137)) ([d9e09e3](https://github.com/browserbase/sdk-python/commit/d9e09e3d2428a92c29a4411533564637ce5b3121))
26+
27+
28+
### Chores
29+
30+
* **client:** minor internal fixes ([47df6f5](https://github.com/browserbase/sdk-python/commit/47df6f5956507649f684df46bf2b5bb18aa7bc93))
31+
* **docs:** update client docstring ([#129](https://github.com/browserbase/sdk-python/issues/129)) ([b2201f1](https://github.com/browserbase/sdk-python/commit/b2201f1d9f99f67a3b8fa21ba19560e72a245611))
32+
* fix typos ([#142](https://github.com/browserbase/sdk-python/issues/142)) ([0157632](https://github.com/browserbase/sdk-python/commit/015763281689247799dd97e46884ba3be520c2f5))
33+
* **internal:** bump rye to 0.44.0 ([#136](https://github.com/browserbase/sdk-python/issues/136)) ([9aeac01](https://github.com/browserbase/sdk-python/commit/9aeac01a20df8303f806e22b274bdd10adaeea49))
34+
* **internal:** codegen related update ([#124](https://github.com/browserbase/sdk-python/issues/124)) ([0678102](https://github.com/browserbase/sdk-python/commit/0678102eee40182b0fc2c2a2b2e3f965a2885a50))
35+
* **internal:** codegen related update ([#132](https://github.com/browserbase/sdk-python/issues/132)) ([3248d7e](https://github.com/browserbase/sdk-python/commit/3248d7e6242808bcb74427cb1b78ac52dee0948c))
36+
* **internal:** expand CI branch coverage ([4494839](https://github.com/browserbase/sdk-python/commit/449483977d4af8b56b916d555bea966f25304ac7))
37+
* **internal:** fix devcontainers setup ([#126](https://github.com/browserbase/sdk-python/issues/126)) ([eaf577b](https://github.com/browserbase/sdk-python/commit/eaf577b05bd72e2bb40105131a65e7c13172c3bb))
38+
* **internal:** properly set __pydantic_private__ ([#127](https://github.com/browserbase/sdk-python/issues/127)) ([5236106](https://github.com/browserbase/sdk-python/commit/52361065d4547b06c44a07396e0679f588181053))
39+
* **internal:** reduce CI branch coverage ([1bd4d8b](https://github.com/browserbase/sdk-python/commit/1bd4d8bf088ac47c01a12048cb7b3c963d18eb4a))
40+
* **internal:** remove extra empty newlines ([#134](https://github.com/browserbase/sdk-python/issues/134)) ([2206050](https://github.com/browserbase/sdk-python/commit/22060504e0f57402decfff129778a472717e29e1))
41+
* **internal:** remove trailing character ([#145](https://github.com/browserbase/sdk-python/issues/145)) ([2b055d7](https://github.com/browserbase/sdk-python/commit/2b055d730b2313227a0193cfc2b95056d4731464))
42+
* **internal:** remove unused http client options forwarding ([#130](https://github.com/browserbase/sdk-python/issues/130)) ([c63a3bd](https://github.com/browserbase/sdk-python/commit/c63a3bdad3f35658d87d48bbd5e746a36228a8ab))
43+
* **internal:** slight transform perf improvement ([#147](https://github.com/browserbase/sdk-python/issues/147)) ([2d46582](https://github.com/browserbase/sdk-python/commit/2d46582e5bb55d3ca74c2a4191144743d5f0058b))
44+
* **internal:** update client tests ([#121](https://github.com/browserbase/sdk-python/issues/121)) ([862cd7e](https://github.com/browserbase/sdk-python/commit/862cd7efb4c694866ab385c5a70fd450b917f057))
45+
* **internal:** update pyright settings ([0f0e110](https://github.com/browserbase/sdk-python/commit/0f0e110388f893b86881aa67badc30af8e271b8a))
46+
* slight wording improvement in README ([#148](https://github.com/browserbase/sdk-python/issues/148)) ([c40603c](https://github.com/browserbase/sdk-python/commit/c40603cafa809128edeff23eca37db97dda8de54))
47+
48+
49+
### Documentation
50+
51+
* update URLs from stainlessapi.com to stainless.com ([#128](https://github.com/browserbase/sdk-python/issues/128)) ([5e2932f](https://github.com/browserbase/sdk-python/commit/5e2932f5c13c19eb454116ffdce38863556feaf1))
52+
353
## 1.2.0 (2025-02-11)
454

555
Full Changelog: [v1.1.0...v1.2.0](https://github.com/browserbase/sdk-python/compare/v1.1.0...v1.2.0)

README.md

+62-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Browserbase Python library provides convenient access to the Browserbase RES
66
application. The library includes type definitions for all request params and response fields,
77
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
88

9-
It is generated with [Stainless](https://www.stainlessapi.com/).
9+
It is generated with [Stainless](https://www.stainless.com/).
1010

1111
## Documentation
1212

@@ -90,6 +90,67 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
9090

9191
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
9292

93+
## Nested params
94+
95+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
96+
97+
```python
98+
from browserbase import Browserbase
99+
100+
client = Browserbase()
101+
102+
session = client.sessions.create(
103+
project_id="projectId",
104+
browser_settings={
105+
"advanced_stealth": True,
106+
"block_ads": True,
107+
"context": {
108+
"id": "id",
109+
"persist": True,
110+
},
111+
"extension_id": "extensionId",
112+
"fingerprint": {
113+
"browsers": ["chrome"],
114+
"devices": ["desktop"],
115+
"http_version": "1",
116+
"locales": ["string"],
117+
"operating_systems": ["android"],
118+
"screen": {
119+
"max_height": 0,
120+
"max_width": 0,
121+
"min_height": 0,
122+
"min_width": 0,
123+
},
124+
},
125+
"log_session": True,
126+
"record_session": True,
127+
"solve_captchas": True,
128+
"viewport": {
129+
"height": 0,
130+
"width": 0,
131+
},
132+
},
133+
)
134+
print(session.browser_settings)
135+
```
136+
137+
## File uploads
138+
139+
Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
140+
141+
```python
142+
from pathlib import Path
143+
from browserbase import Browserbase
144+
145+
client = Browserbase()
146+
147+
client.extensions.create(
148+
file=Path("/path/to/file"),
149+
)
150+
```
151+
152+
The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
153+
93154
## Handling errors
94155

95156
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `browserbase.APIConnectionError` is raised.

SECURITY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Reporting Security Issues
44

5-
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
5+
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
66

7-
To report a security issue, please contact the Stainless team at security@stainlessapi.com.
7+
To report a security issue, please contact the Stainless team at security@stainless.com.
88

99
## Responsible Disclosure
1010

api.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ Methods:
4545
Types:
4646

4747
```python
48-
from browserbase.types import Session, SessionLiveURLs, SessionCreateResponse, SessionListResponse
48+
from browserbase.types import (
49+
Session,
50+
SessionLiveURLs,
51+
SessionCreateResponse,
52+
SessionRetrieveResponse,
53+
SessionListResponse,
54+
)
4955
```
5056

5157
Methods:
5258

5359
- <code title="post /v1/sessions">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">create</a>(\*\*<a href="src/browserbase/types/session_create_params.py">params</a>) -> <a href="./src/browserbase/types/session_create_response.py">SessionCreateResponse</a></code>
54-
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">retrieve</a>(id) -> <a href="./src/browserbase/types/session.py">Session</a></code>
60+
- <code title="get /v1/sessions/{id}">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">retrieve</a>(id) -> <a href="./src/browserbase/types/session_retrieve_response.py">SessionRetrieveResponse</a></code>
5561
- <code title="post /v1/sessions/{id}">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">update</a>(id, \*\*<a href="src/browserbase/types/session_update_params.py">params</a>) -> <a href="./src/browserbase/types/session.py">Session</a></code>
5662
- <code title="get /v1/sessions">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">list</a>(\*\*<a href="src/browserbase/types/session_list_params.py">params</a>) -> <a href="./src/browserbase/types/session_list_response.py">SessionListResponse</a></code>
5763
- <code title="get /v1/sessions/{id}/debug">client.sessions.<a href="./src/browserbase/resources/sessions/sessions.py">debug</a>(id) -> <a href="./src/browserbase/types/session_live_urls.py">SessionLiveURLs</a></code>

bin/publish-pypi

-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
set -eux
44
mkdir -p dist
55
rye build --clean
6-
# Patching importlib-metadata version until upstream library version is updated
7-
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
8-
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
96
rye publish --yes --token=$PYPI_TOKEN

pyproject.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "browserbase"
3-
version = "1.2.0"
3+
version = "1.3.0"
44
description = "The official Python library for the Browserbase API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -38,7 +38,6 @@ Homepage = "https://github.com/browserbase/sdk-python"
3838
Repository = "https://github.com/browserbase/sdk-python"
3939

4040

41-
4241
[tool.rye]
4342
managed = true
4443
# version pins are in requirements-dev.lock
@@ -96,7 +95,7 @@ typecheck = { chain = [
9695
"typecheck:mypy" = "mypy ."
9796

9897
[build-system]
99-
requires = ["hatchling", "hatch-fancy-pypi-readme"]
98+
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
10099
build-backend = "hatchling.build"
101100

102101
[tool.hatch.build]
@@ -157,11 +156,11 @@ exclude = [
157156
]
158157

159158
reportImplicitOverride = true
159+
reportOverlappingOverload = false
160160

161161
reportImportCycles = false
162162
reportPrivateUsage = false
163163

164-
165164
[tool.ruff]
166165
line-length = 120
167166
output-format = "grouped"

scripts/test

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ else
5252
echo
5353
fi
5454

55+
export DEFER_PYDANTIC_BUILD=false
56+
5557
echo "==> Running tests"
5658
rye run pytest "$@"
5759

0 commit comments

Comments
 (0)