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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-9af27d5ca04efd55b732756ee4c81b76331e5ee8ab8c74576a3eaf16faac44f1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-70bae250a6bae7dc6efc73ce837b3244eab63318b2d4de9a77ac8733e104df5b.yml
6 changes: 3 additions & 3 deletions src/browserbase/resources/sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Union, Iterable
from typing import Union
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -104,7 +104,7 @@ def create(
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
extension_id: str | NotGiven = NOT_GIVEN,
keep_alive: bool | NotGiven = NOT_GIVEN,
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
proxies: Union[bool, object] | NotGiven = NOT_GIVEN,
api_timeout: int | NotGiven = NOT_GIVEN,
# 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 Down Expand Up @@ -354,7 +354,7 @@ async def create(
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
extension_id: str | NotGiven = NOT_GIVEN,
keep_alive: bool | NotGiven = NOT_GIVEN,
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
proxies: Union[bool, object] | NotGiven = NOT_GIVEN,
api_timeout: int | NotGiven = NOT_GIVEN,
# 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 Down
63 changes: 3 additions & 60 deletions src/browserbase/types/session_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from __future__ import annotations

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

from .._utils import PropertyInfo

Expand All @@ -14,10 +14,6 @@
"BrowserSettingsFingerprint",
"BrowserSettingsFingerprintScreen",
"BrowserSettingsViewport",
"ProxiesUnionMember1",
"ProxiesUnionMember1BrowserbaseProxyConfig",
"ProxiesUnionMember1BrowserbaseProxyConfigGeolocation",
"ProxiesUnionMember1ExternalProxyConfig",
]


Expand All @@ -42,7 +38,7 @@ class SessionCreateParams(TypedDict, total=False):
This is available on the Startup plan only.
"""

proxies: Union[bool, Iterable[ProxiesUnionMember1]]
proxies: Union[bool, object]
"""Proxy configuration.

Can be true for default proxy, or an array of proxy configurations.
Expand Down Expand Up @@ -131,56 +127,3 @@ class BrowserSettings(TypedDict, total=False):
"""Enable or disable captcha solving in the browser. Defaults to `true`."""

viewport: BrowserSettingsViewport


class ProxiesUnionMember1BrowserbaseProxyConfigGeolocation(TypedDict, total=False):
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 ProxiesUnionMember1BrowserbaseProxyConfig(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: ProxiesUnionMember1BrowserbaseProxyConfigGeolocation
"""Configuration for geolocation"""


class ProxiesUnionMember1ExternalProxyConfig(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."""


ProxiesUnionMember1: TypeAlias = Union[
ProxiesUnionMember1BrowserbaseProxyConfig, ProxiesUnionMember1ExternalProxyConfig
]