Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -44,7 +44,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.15.0"
".": "1.16.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-98cc68ad9afa71355baf2b31f305a5e2f3a315fd311c96659405eff96b8f2b1e.yml
openapi_spec_hash: 71dfbc1021a33dd7fc9d82844965b1b3
config_hash: 6209a285dd5980f5c418fe6575723aef
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/browserbase-586ac4eb1ad67a46c520dab6766f734d5dc6cc852a7f45ec56cf3f0c8ea6c4e0.yml
openapi_spec_hash: aa9de37972bc4bf33b5376159d9326cb
config_hash: 12a5eb5ac818623045ae77075ee3dd53
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.16.0 (2026-08-04)

Full Changelog: [v1.15.0...v1.16.0](https://github.com/browserbase/sdk-python/compare/v1.15.0...v1.16.0)

### Features

* [CORE-2365] Add optional name to create and get Context API ([b2f4057](https://github.com/browserbase/sdk-python/commit/b2f4057417297ea0f6626e72b51d8a6c435960f6))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([c9098bb](https://github.com/browserbase/sdk-python/commit/c9098bb75d7ad2a4a84e55c0f0b0c65a5a61078b))

## 1.15.0 (2026-07-14)

Full Changelog: [v1.14.0...v1.15.0](https://github.com/browserbase/sdk-python/compare/v1.14.0...v1.15.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "browserbase"
version = "1.15.0"
version = "1.16.0"
description = "The official Python library for the Browserbase API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/browserbase/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "browserbase"
__version__ = "1.15.0" # x-release-please-version
__version__ = "1.16.0" # x-release-please-version
34 changes: 28 additions & 6 deletions src/browserbase/resources/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def with_streaming_response(self) -> ContextsResourceWithStreamingResponse:
def create(
self,
*,
name: str | Omit = omit,
project_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -57,9 +58,13 @@ def create(
"""Create a Context

Args:
project_id: The Project ID.
name: Optional user-defined name for the Context.

Can be found in
Leading and trailing whitespace is
trimmed before storage. Names are unique within the project among active
Contexts, compared case-insensitively.

project_id: The Project ID. Can be found in
[Settings](https://www.browserbase.com/settings). Optional - if not provided,
the project will be inferred from the API key.

Expand All @@ -73,7 +78,13 @@ def create(
"""
return self._post(
"/v1/contexts",
body=maybe_transform({"project_id": project_id}, context_create_params.ContextCreateParams),
body=maybe_transform(
{
"name": name,
"project_id": project_id,
},
context_create_params.ContextCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down Expand Up @@ -204,6 +215,7 @@ def with_streaming_response(self) -> AsyncContextsResourceWithStreamingResponse:
async def create(
self,
*,
name: str | Omit = omit,
project_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -215,9 +227,13 @@ async def create(
"""Create a Context

Args:
project_id: The Project ID.
name: Optional user-defined name for the Context.

Can be found in
Leading and trailing whitespace is
trimmed before storage. Names are unique within the project among active
Contexts, compared case-insensitively.

project_id: The Project ID. Can be found in
[Settings](https://www.browserbase.com/settings). Optional - if not provided,
the project will be inferred from the API key.

Expand All @@ -231,7 +247,13 @@ async def create(
"""
return await self._post(
"/v1/contexts",
body=await async_maybe_transform({"project_id": project_id}, context_create_params.ContextCreateParams),
body=await async_maybe_transform(
{
"name": name,
"project_id": project_id,
},
context_create_params.ContextCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand Down
8 changes: 8 additions & 0 deletions src/browserbase/types/context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from datetime import datetime

from pydantic import Field as FieldInfo
Expand All @@ -18,3 +19,10 @@ class Context(BaseModel):
"""The Project ID linked to the uploaded Context."""

updated_at: datetime = FieldInfo(alias="updatedAt")

name: Optional[str] = None
"""Optional user-defined name for the Context.

Leading and trailing whitespace is trimmed before storage. Names are unique
within the project among active Contexts, compared case-insensitively.
"""
7 changes: 7 additions & 0 deletions src/browserbase/types/context_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@


class ContextCreateParams(TypedDict, total=False):
name: str
"""Optional user-defined name for the Context.

Leading and trailing whitespace is trimmed before storage. Names are unique
within the project among active Contexts, compared case-insensitively.
"""

project_id: Annotated[str, PropertyInfo(alias="projectId")]
"""The Project ID.

Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_method_create(self, client: Browserbase) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Browserbase) -> None:
context = client.contexts.create(
name="x",
project_id="projectId",
)
assert_matches_type(ContextCreateResponse, context, path=["response"])
Expand Down Expand Up @@ -177,6 +178,7 @@ async def test_method_create(self, async_client: AsyncBrowserbase) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncBrowserbase) -> None:
context = await async_client.contexts.create(
name="x",
project_id="projectId",
)
assert_matches_type(ContextCreateResponse, context, path=["response"])
Expand Down