Skip to content

Commit 5be14e9

Browse files
feat(api): api update (#101)
1 parent b617b85 commit 5be14e9

File tree

7 files changed

+20
-3
lines changed

7 files changed

+20
-3
lines changed

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-7f88912695bab2b98cb73137e6f36125d02fdfaf8eed4532ee1c82385609a259.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3b940292f5146d4659546ef49685da0a2877a622957e2cf48c6bc2ccf3c153ca.yml

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

+8
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def create(
108108
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
109109
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
110110
api_timeout: int | NotGiven = NOT_GIVEN,
111+
user_metadata: object | NotGiven = NOT_GIVEN,
111112
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
112113
# The extra values given here take precedence over values defined on the client or passed to this method.
113114
extra_headers: Headers | None = None,
@@ -137,6 +138,8 @@ def create(
137138
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
138139
the Project's `defaultTimeout`.
139140
141+
user_metadata: Arbitrary user metadata to attach to the session.
142+
140143
extra_headers: Send extra headers
141144
142145
extra_query: Add additional query parameters to the request
@@ -156,6 +159,7 @@ def create(
156159
"proxies": proxies,
157160
"region": region,
158161
"api_timeout": api_timeout,
162+
"user_metadata": user_metadata,
159163
},
160164
session_create_params.SessionCreateParams,
161165
),
@@ -362,6 +366,7 @@ async def create(
362366
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
363367
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
364368
api_timeout: int | NotGiven = NOT_GIVEN,
369+
user_metadata: object | NotGiven = NOT_GIVEN,
365370
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
366371
# The extra values given here take precedence over values defined on the client or passed to this method.
367372
extra_headers: Headers | None = None,
@@ -391,6 +396,8 @@ async def create(
391396
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
392397
the Project's `defaultTimeout`.
393398
399+
user_metadata: Arbitrary user metadata to attach to the session.
400+
394401
extra_headers: Send extra headers
395402
396403
extra_query: Add additional query parameters to the request
@@ -410,6 +417,7 @@ async def create(
410417
"proxies": proxies,
411418
"region": region,
412419
"api_timeout": api_timeout,
420+
"user_metadata": user_metadata,
413421
},
414422
session_create_params.SessionCreateParams,
415423
),

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

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ class Session(BaseModel):
4646

4747
memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None)
4848
"""Memory used by the Session"""
49+
50+
user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None)
51+
"""Arbitrary user metadata to attach to the session."""

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

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class SessionCreateParams(TypedDict, total=False):
5757
Defaults to the Project's `defaultTimeout`.
5858
"""
5959

60+
user_metadata: Annotated[object, PropertyInfo(alias="userMetadata")]
61+
"""Arbitrary user metadata to attach to the session."""
62+
6063

6164
class BrowserSettingsContext(TypedDict, total=False):
6265
id: Required[str]

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

+3
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ class SessionCreateResponse(BaseModel):
5555

5656
memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None)
5757
"""Memory used by the Session"""
58+
59+
user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None)
60+
"""Arbitrary user metadata to attach to the session."""

Diff for: src/browserbase/types/sessions/session_log.py

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class Response(BaseModel):
2828

2929

3030
class SessionLog(BaseModel):
31-
event_id: str = FieldInfo(alias="eventId")
32-
3331
method: str
3432

3533
page_id: int = FieldInfo(alias="pageId")

Diff for: tests/api_resources/test_sessions.py

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None:
6666
proxies=True,
6767
region="us-west-2",
6868
api_timeout=60,
69+
user_metadata={},
6970
)
7071
assert_matches_type(SessionCreateResponse, session, path=["response"])
7172

@@ -295,6 +296,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas
295296
proxies=True,
296297
region="us-west-2",
297298
api_timeout=60,
299+
user_metadata={},
298300
)
299301
assert_matches_type(SessionCreateResponse, session, path=["response"])
300302

0 commit comments

Comments
 (0)