Skip to content

Commit f46e475

Browse files
feat(api): manual updates
1 parent b20fc56 commit f46e475

File tree

4 files changed

+24
-26
lines changed

4 files changed

+24
-26
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b92143ddb16135de4ff65ce8bcdfe9991d11c73570f42f07ea27e0da86209a44.yml
3-
openapi_spec_hash: 16eb6e6c9687f01d2a791775b27dc315
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-af59f86ea3ee682d54560eaf6055df5bebacee560749f5f3cbd9c8ff8b5fa8e5.yml
3+
openapi_spec_hash: 72dfdba2efc46c7cbbaa98bd234b72de
44
config_hash: 99e5318dc8a8d75839ec565d94276c71

src/browserbase/resources/sessions/sessions.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ def with_streaming_response(self) -> SessionsResourceWithStreamingResponse:
9999
def create(
100100
self,
101101
*,
102+
api_timeout: int | Omit = omit,
102103
browser_settings: session_create_params.BrowserSettings | Omit = omit,
103104
extension_id: str | Omit = omit,
104105
keep_alive: bool | Omit = omit,
105106
project_id: str | Omit = omit,
106107
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | Omit = omit,
107108
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | Omit = omit,
108-
api_timeout: int | Omit = omit,
109109
user_metadata: Dict[str, object] | Omit = omit,
110110
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111111
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -114,12 +114,14 @@ def create(
114114
extra_body: Body | None = None,
115115
timeout: float | httpx.Timeout | None | NotGiven = not_given,
116116
) -> SessionCreateResponse:
117-
"""Create a Session
117+
"""
118+
Create a Session
118119
119120
Args:
120-
extension_id: The uploaded Extension ID.
121+
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
122+
the Project's `defaultTimeout`.
121123
122-
See
124+
extension_id: The uploaded Extension ID. See
123125
[Upload Extension](/reference/api/upload-an-extension).
124126
125127
keep_alive: Set to true to keep the session alive even after disconnections. Available on
@@ -133,9 +135,6 @@ def create(
133135
134136
region: The region where the Session should run.
135137
136-
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
137-
the Project's `defaultTimeout`.
138-
139138
user_metadata: Arbitrary user metadata to attach to the session. To learn more about user
140139
metadata, see [User Metadata](/features/sessions#user-metadata).
141140
@@ -151,13 +150,13 @@ def create(
151150
"/v1/sessions",
152151
body=maybe_transform(
153152
{
153+
"api_timeout": api_timeout,
154154
"browser_settings": browser_settings,
155155
"extension_id": extension_id,
156156
"keep_alive": keep_alive,
157157
"project_id": project_id,
158158
"proxies": proxies,
159159
"region": region,
160-
"api_timeout": api_timeout,
161160
"user_metadata": user_metadata,
162161
},
163162
session_create_params.SessionCreateParams,
@@ -369,13 +368,13 @@ def with_streaming_response(self) -> AsyncSessionsResourceWithStreamingResponse:
369368
async def create(
370369
self,
371370
*,
371+
api_timeout: int | Omit = omit,
372372
browser_settings: session_create_params.BrowserSettings | Omit = omit,
373373
extension_id: str | Omit = omit,
374374
keep_alive: bool | Omit = omit,
375375
project_id: str | Omit = omit,
376376
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | Omit = omit,
377377
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | Omit = omit,
378-
api_timeout: int | Omit = omit,
379378
user_metadata: Dict[str, object] | Omit = omit,
380379
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
381380
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -384,12 +383,14 @@ async def create(
384383
extra_body: Body | None = None,
385384
timeout: float | httpx.Timeout | None | NotGiven = not_given,
386385
) -> SessionCreateResponse:
387-
"""Create a Session
386+
"""
387+
Create a Session
388388
389389
Args:
390-
extension_id: The uploaded Extension ID.
390+
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
391+
the Project's `defaultTimeout`.
391392
392-
See
393+
extension_id: The uploaded Extension ID. See
393394
[Upload Extension](/reference/api/upload-an-extension).
394395
395396
keep_alive: Set to true to keep the session alive even after disconnections. Available on
@@ -403,9 +404,6 @@ async def create(
403404
404405
region: The region where the Session should run.
405406
406-
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
407-
the Project's `defaultTimeout`.
408-
409407
user_metadata: Arbitrary user metadata to attach to the session. To learn more about user
410408
metadata, see [User Metadata](/features/sessions#user-metadata).
411409
@@ -421,13 +419,13 @@ async def create(
421419
"/v1/sessions",
422420
body=await async_maybe_transform(
423421
{
422+
"api_timeout": api_timeout,
424423
"browser_settings": browser_settings,
425424
"extension_id": extension_id,
426425
"keep_alive": keep_alive,
427426
"project_id": project_id,
428427
"proxies": proxies,
429428
"region": region,
430-
"api_timeout": api_timeout,
431429
"user_metadata": user_metadata,
432430
},
433431
session_create_params.SessionCreateParams,

src/browserbase/types/session_create_params.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222

2323
class SessionCreateParams(TypedDict, total=False):
24+
api_timeout: int
25+
"""Duration in seconds after which the session will automatically end.
26+
27+
Defaults to the Project's `defaultTimeout`.
28+
"""
29+
2430
browser_settings: Annotated[BrowserSettings, PropertyInfo(alias="browserSettings")]
2531

2632
extension_id: Annotated[str, PropertyInfo(alias="extensionId")]
@@ -50,12 +56,6 @@ class SessionCreateParams(TypedDict, total=False):
5056
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"]
5157
"""The region where the Session should run."""
5258

53-
api_timeout: Annotated[int, PropertyInfo(alias="timeout")]
54-
"""Duration in seconds after which the session will automatically end.
55-
56-
Defaults to the Project's `defaultTimeout`.
57-
"""
58-
5959
user_metadata: Annotated[Dict[str, object], PropertyInfo(alias="userMetadata")]
6060
"""Arbitrary user metadata to attach to the session.
6161

tests/api_resources/test_sessions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def test_method_create(self, client: Browserbase) -> None:
3131
@parametrize
3232
def test_method_create_with_all_params(self, client: Browserbase) -> None:
3333
session = client.sessions.create(
34+
api_timeout=60,
3435
browser_settings={
3536
"advanced_stealth": True,
3637
"block_ads": True,
@@ -55,7 +56,6 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None:
5556
project_id="projectId",
5657
proxies=True,
5758
region="us-west-2",
58-
api_timeout=60,
5959
user_metadata={"foo": "bar"},
6060
)
6161
assert_matches_type(SessionCreateResponse, session, path=["response"])
@@ -254,6 +254,7 @@ async def test_method_create(self, async_client: AsyncBrowserbase) -> None:
254254
@parametrize
255255
async def test_method_create_with_all_params(self, async_client: AsyncBrowserbase) -> None:
256256
session = await async_client.sessions.create(
257+
api_timeout=60,
257258
browser_settings={
258259
"advanced_stealth": True,
259260
"block_ads": True,
@@ -278,7 +279,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas
278279
project_id="projectId",
279280
proxies=True,
280281
region="us-west-2",
281-
api_timeout=60,
282282
user_metadata={"foo": "bar"},
283283
)
284284
assert_matches_type(SessionCreateResponse, session, path=["response"])

0 commit comments

Comments
 (0)