Skip to content

Commit 17f263b

Browse files
chore(internal): codegen related update (#132)
1 parent 523389c commit 17f263b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,50 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
7777

7878
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`.
7979

80+
## Nested params
81+
82+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
83+
84+
```python
85+
from browserbase import Browserbase
86+
87+
client = Browserbase()
88+
89+
session = client.sessions.create(
90+
project_id="projectId",
91+
browser_settings={
92+
"advanced_stealth": True,
93+
"block_ads": True,
94+
"context": {
95+
"id": "id",
96+
"persist": True,
97+
},
98+
"extension_id": "extensionId",
99+
"fingerprint": {
100+
"browsers": ["chrome"],
101+
"devices": ["desktop"],
102+
"http_version": 1,
103+
"locales": ["string"],
104+
"operating_systems": ["android"],
105+
"screen": {
106+
"max_height": 0,
107+
"max_width": 0,
108+
"min_height": 0,
109+
"min_width": 0,
110+
},
111+
},
112+
"log_session": True,
113+
"record_session": True,
114+
"solve_captchas": True,
115+
"viewport": {
116+
"height": 0,
117+
"width": 0,
118+
},
119+
},
120+
)
121+
print(session.browser_settings)
122+
```
123+
80124
## File uploads
81125

82126
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.

scripts/test

Lines changed: 2 additions & 0 deletions
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)