Skip to content
Merged
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-0764e25c8c07b520e25c38c8455fca106a51fd8b13f8260b9db9729d6a556b2e.yml
openapi_spec_hash: aed91a76db495a87ca16737b91b0c51c
config_hash: 12a5eb5ac818623045ae77075ee3dd53
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.16.0 (2026-08-10)

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

### Features

* [AI-2679] Deprecate presigned-url context uploads ([72cc359](https://github.com/browserbase/sdk-python/commit/72cc35934740f8ccb84f036bba455051177e80b5))
* [CORE-2365] Add optional name to create and get Context API ([b2f4057](https://github.com/browserbase/sdk-python/commit/b2f4057417297ea0f6626e72b51d8a6c435960f6))
* [STG-2717] Pass-thru `proxy` config for session creation in `/v1/agents/runs` ([37ac241](https://github.com/browserbase/sdk-python/commit/37ac24172e12a3a6417714d12afa7984217dde06))
* **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
62 changes: 48 additions & 14 deletions src/browserbase/resources/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from __future__ import annotations

import typing_extensions

import httpx

from ..types import context_create_params
Expand Down Expand Up @@ -46,6 +48,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 +60,13 @@ def create(
"""Create a Context

Args:
project_id: The Project ID.
name: 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.

Can be found in
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 +80,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 @@ -113,6 +126,7 @@ def retrieve(
cast_to=Context,
)

@typing_extensions.deprecated("deprecated")
def update(
self,
id: str,
Expand Down Expand Up @@ -204,6 +218,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 +230,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 +250,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 Expand Up @@ -271,6 +296,7 @@ async def retrieve(
cast_to=Context,
)

@typing_extensions.deprecated("deprecated")
async def update(
self,
id: str,
Expand Down Expand Up @@ -349,8 +375,10 @@ def __init__(self, contexts: ContextsResource) -> None:
self.retrieve = to_raw_response_wrapper(
contexts.retrieve,
)
self.update = to_raw_response_wrapper(
contexts.update,
self.update = ( # pyright: ignore[reportDeprecated]
to_raw_response_wrapper(
contexts.update, # pyright: ignore[reportDeprecated],
)
)
self.delete = to_raw_response_wrapper(
contexts.delete,
Expand All @@ -367,8 +395,10 @@ def __init__(self, contexts: AsyncContextsResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
contexts.retrieve,
)
self.update = async_to_raw_response_wrapper(
contexts.update,
self.update = ( # pyright: ignore[reportDeprecated]
async_to_raw_response_wrapper(
contexts.update, # pyright: ignore[reportDeprecated],
)
)
self.delete = async_to_raw_response_wrapper(
contexts.delete,
Expand All @@ -385,8 +415,10 @@ def __init__(self, contexts: ContextsResource) -> None:
self.retrieve = to_streamed_response_wrapper(
contexts.retrieve,
)
self.update = to_streamed_response_wrapper(
contexts.update,
self.update = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
contexts.update, # pyright: ignore[reportDeprecated],
)
)
self.delete = to_streamed_response_wrapper(
contexts.delete,
Expand All @@ -403,8 +435,10 @@ def __init__(self, contexts: AsyncContextsResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
contexts.retrieve,
)
self.update = async_to_streamed_response_wrapper(
contexts.update,
self.update = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
contexts.update, # pyright: ignore[reportDeprecated],
)
)
self.delete = async_to_streamed_response_wrapper(
contexts.delete,
Expand Down
91 changes: 86 additions & 5 deletions src/browserbase/types/agents/run_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@

from __future__ import annotations

from typing import Dict
from typing_extensions import Required, Annotated, TypedDict
from typing import Dict, Union, Iterable
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict

from ..._utils import PropertyInfo

__all__ = ["RunCreateParams", "BrowserSettings", "BrowserSettingsContext", "Variables"]
__all__ = [
"RunCreateParams",
"BrowserSettings",
"BrowserSettingsContext",
"BrowserSettingsProxiesUnionMember0",
"BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfig",
"BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfigGeolocation",
"BrowserSettingsProxiesUnionMember0ExternalProxyConfig",
"BrowserSettingsProxiesUnionMember0NoneProxyConfig",
"Variables",
]


class RunCreateParams(TypedDict, total=False):
Expand Down Expand Up @@ -52,6 +62,74 @@ class BrowserSettingsContext(TypedDict, total=False):
"""Whether to persist the context after browsing. Defaults to false."""


class BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfigGeolocation(TypedDict, total=False):
"""Geographic location for the proxy. Optional."""

country: Required[str]
"""Country code in ISO 3166-1 alpha-2 format"""

city: str
"""Name of the city. Use spaces for multi-word city names. Optional."""

state: str
"""US state code (2 characters). Must also specify US as the country. Optional."""


class BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfig(TypedDict, total=False):
type: Required[Literal["browserbase"]]
"""Type of proxy.

Always use 'browserbase' for the Browserbase managed proxy network.
"""

domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
"""Domain pattern for which this proxy should be used.

If omitted, defaults to all domains. Optional.
"""

geolocation: BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfigGeolocation
"""Geographic location for the proxy. Optional."""


class BrowserSettingsProxiesUnionMember0ExternalProxyConfig(TypedDict, total=False):
server: Required[str]
"""Server URL for external proxy. Required."""

type: Required[Literal["external"]]
"""Type of proxy. Always 'external' for this config."""

domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
"""Domain pattern for which this proxy should be used.

If omitted, defaults to all domains. Optional.
"""

password: str
"""Password for external proxy authentication. Optional."""

username: str
"""Username for external proxy authentication. Optional."""


class BrowserSettingsProxiesUnionMember0NoneProxyConfig(TypedDict, total=False):
type: Required[Literal["none"]]
"""Type of proxy. Always 'none' for this config."""

domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
"""Domain pattern for which this proxy should be used.

If omitted, defaults to all domains. Optional.
"""


BrowserSettingsProxiesUnionMember0: TypeAlias = Union[
BrowserSettingsProxiesUnionMember0BrowserbaseProxyConfig,
BrowserSettingsProxiesUnionMember0ExternalProxyConfig,
BrowserSettingsProxiesUnionMember0NoneProxyConfig,
]


class BrowserSettings(TypedDict, total=False):
"""Browser configuration for the agent's session.

Expand All @@ -60,8 +138,11 @@ class BrowserSettings(TypedDict, total=False):

context: BrowserSettingsContext

proxies: bool
"""Set true to route the agent's browser session through the default proxy."""
proxies: Union[Iterable[BrowserSettingsProxiesUnionMember0], bool]
"""Proxy configuration.

Can be true for default proxy, or an array of proxy configurations.
"""

verified: bool
"""Set true to enable Browserbase Verified for the session."""
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
7 changes: 6 additions & 1 deletion src/browserbase/types/context_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ class ContextCreateResponse(BaseModel):
"""The public key to encrypt the user-data-directory."""

upload_url: str = FieldInfo(alias="uploadUrl")
"""An upload URL to upload a custom user-data-directory."""
"""Deprecated.

Browserbase no longer supports context uploads via the API; this field always
contains a non-functional sentinel URL and remains only for backwards
compatibility.
"""
7 changes: 6 additions & 1 deletion src/browserbase/types/context_update_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ class ContextUpdateResponse(BaseModel):
"""The public key to encrypt the user-data-directory."""

upload_url: str = FieldInfo(alias="uploadUrl")
"""An upload URL to upload a custom user-data-directory."""
"""Deprecated.

Browserbase no longer supports context uploads via the API; this field always
contains a non-functional sentinel URL and remains only for backwards
compatibility.
"""
Loading