Skip to content

Commit 3c04086

Browse files
feat: Revert "[STG-1573] Add providerOptions for extensible model auth (#1822)"
1 parent 078ab5c commit 3c04086

7 files changed

Lines changed: 61 additions & 397 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-a8db51c6460b3daff67b35262517848a0d4e783c6805c2edd531b155a5db71dd.yml
3-
openapi_spec_hash: c6e7127f211f946673d6389e1d8db1ba
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-1c6caa2891a7f3bdfc0caab143f285badc9145220c9b29cd5e4cf1a9b3ac11cf.yml
3+
openapi_spec_hash: 28c4b734a5309067c39bb4c4b709b9ab
44
config_hash: a962ae71493deb11a1c903256fb25386

src/stagehand/resources/sessions.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,6 @@ def start(
927927
browserbase_session_id: str | Omit = omit,
928928
dom_settle_timeout_ms: float | Omit = omit,
929929
experimental: bool | Omit = omit,
930-
model_client_options: session_start_params.ModelClientOptions | Omit = omit,
931930
self_heal: bool | Omit = omit,
932931
system_prompt: str | Omit = omit,
933932
verbose: Literal[0, 1, 2] | Omit = omit,
@@ -958,9 +957,6 @@ def start(
958957
959958
dom_settle_timeout_ms: Timeout in ms to wait for DOM to settle
960959
961-
model_client_options: Optional provider-specific configuration for the session model (for example
962-
Bedrock region and credentials)
963-
964960
self_heal: Enable self-healing for failed actions
965961
966962
system_prompt: Custom system prompt for AI operations
@@ -1001,7 +997,6 @@ def start(
1001997
"browserbase_session_id": browserbase_session_id,
1002998
"dom_settle_timeout_ms": dom_settle_timeout_ms,
1003999
"experimental": experimental,
1004-
"model_client_options": model_client_options,
10051000
"self_heal": self_heal,
10061001
"system_prompt": system_prompt,
10071002
"verbose": verbose,
@@ -1895,7 +1890,6 @@ async def start(
18951890
browserbase_session_id: str | Omit = omit,
18961891
dom_settle_timeout_ms: float | Omit = omit,
18971892
experimental: bool | Omit = omit,
1898-
model_client_options: session_start_params.ModelClientOptions | Omit = omit,
18991893
self_heal: bool | Omit = omit,
19001894
system_prompt: str | Omit = omit,
19011895
verbose: Literal[0, 1, 2] | Omit = omit,
@@ -1926,9 +1920,6 @@ async def start(
19261920
19271921
dom_settle_timeout_ms: Timeout in ms to wait for DOM to settle
19281922
1929-
model_client_options: Optional provider-specific configuration for the session model (for example
1930-
Bedrock region and credentials)
1931-
19321923
self_heal: Enable self-healing for failed actions
19331924
19341925
system_prompt: Custom system prompt for AI operations
@@ -1969,7 +1960,6 @@ async def start(
19691960
"browserbase_session_id": browserbase_session_id,
19701961
"dom_settle_timeout_ms": dom_settle_timeout_ms,
19711962
"experimental": experimental,
1972-
"model_client_options": model_client_options,
19731963
"self_heal": self_heal,
19741964
"system_prompt": system_prompt,
19751965
"verbose": verbose,

src/stagehand/types/model_config_param.py

Lines changed: 4 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2,92 +2,12 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union
6-
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
5+
from typing import Dict
6+
from typing_extensions import Literal, Required, Annotated, TypedDict
77

88
from .._utils import PropertyInfo
99

10-
__all__ = [
11-
"ModelConfigParam",
12-
"ProviderOptions",
13-
"ProviderOptionsBedrockAPIKeyProviderOptions",
14-
"ProviderOptionsBedrockAwsCredentialsProviderOptions",
15-
"ProviderOptionsGoogleVertexProviderOptions",
16-
"ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptions",
17-
"ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptionsCredentials",
18-
]
19-
20-
21-
class ProviderOptionsBedrockAPIKeyProviderOptions(TypedDict, total=False):
22-
region: Required[str]
23-
"""AWS region for Amazon Bedrock"""
24-
25-
26-
class ProviderOptionsBedrockAwsCredentialsProviderOptions(TypedDict, total=False):
27-
access_key_id: Required[Annotated[str, PropertyInfo(alias="accessKeyId")]]
28-
"""AWS access key ID for Bedrock"""
29-
30-
region: Required[str]
31-
"""AWS region for Amazon Bedrock"""
32-
33-
secret_access_key: Required[Annotated[str, PropertyInfo(alias="secretAccessKey")]]
34-
"""AWS secret access key for Bedrock"""
35-
36-
session_token: Annotated[str, PropertyInfo(alias="sessionToken")]
37-
"""Optional AWS session token for temporary credentials"""
38-
39-
40-
class ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptionsCredentials(TypedDict, total=False):
41-
auth_provider_x509_cert_url: str
42-
43-
auth_uri: str
44-
45-
client_email: str
46-
47-
client_id: str
48-
49-
client_x509_cert_url: str
50-
51-
private_key: str
52-
53-
private_key_id: str
54-
55-
project_id: str
56-
57-
token_uri: str
58-
59-
type: str
60-
61-
universe_domain: str
62-
63-
64-
class ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptions(TypedDict, total=False):
65-
"""Optional Google auth options for Vertex AI"""
66-
67-
credentials: ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptionsCredentials
68-
69-
70-
class ProviderOptionsGoogleVertexProviderOptions(TypedDict, total=False):
71-
google_auth_options: Annotated[
72-
ProviderOptionsGoogleVertexProviderOptionsGoogleAuthOptions, PropertyInfo(alias="googleAuthOptions")
73-
]
74-
"""Optional Google auth options for Vertex AI"""
75-
76-
headers: Dict[str, str]
77-
"""Custom headers for Vertex AI requests"""
78-
79-
location: str
80-
"""Google Cloud location for Vertex AI"""
81-
82-
project: str
83-
"""Google Cloud project ID for Vertex AI"""
84-
85-
86-
ProviderOptions: TypeAlias = Union[
87-
ProviderOptionsBedrockAPIKeyProviderOptions,
88-
ProviderOptionsBedrockAwsCredentialsProviderOptions,
89-
ProviderOptionsGoogleVertexProviderOptions,
90-
]
10+
__all__ = ["ModelConfigParam"]
9111

9212

9313
class ModelConfigParam(TypedDict, total=False):
@@ -101,20 +21,7 @@ class ModelConfigParam(TypedDict, total=False):
10121
"""Base URL for the model provider"""
10222

10323
headers: Dict[str, str]
104-
"""Custom headers for the model provider"""
24+
"""Custom headers sent with every request to the model provider"""
10525

10626
provider: Literal["openai", "anthropic", "google", "microsoft", "bedrock"]
10727
"""AI provider for the model (or provide a baseURL endpoint instead)"""
108-
109-
provider_options: Annotated[ProviderOptions, PropertyInfo(alias="providerOptions")]
110-
"""Provider-specific options passed through to the AI SDK provider constructor.
111-
112-
For Bedrock: { region, accessKeyId, secretAccessKey, sessionToken }. For Vertex:
113-
{ project, location, googleAuthOptions }.
114-
"""
115-
116-
skip_api_key_fallback: Annotated[bool, PropertyInfo(alias="skipApiKeyFallback")]
117-
"""When true, hosted sessions will not copy x-model-api-key into model.apiKey.
118-
119-
Use this when auth is carried through providerOptions instead of an API key.
120-
"""

src/stagehand/types/session_execute_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class ExecuteOptions(TypedDict, total=False):
7676
max_steps: Annotated[float, PropertyInfo(alias="maxSteps")]
7777
"""Maximum number of steps the agent can take"""
7878

79+
tool_timeout: Annotated[float, PropertyInfo(alias="toolTimeout")]
80+
"""Timeout in milliseconds for each agent tool call"""
81+
82+
use_search: Annotated[bool, PropertyInfo(alias="useSearch")]
83+
"""Whether to enable the web search tool powered by Browserbase Search API"""
84+
7985

8086
class SessionExecuteParamsNonStreaming(SessionExecuteParamsBase, total=False):
8187
stream_response: Annotated[Literal[False], PropertyInfo(alias="streamResponse")]

0 commit comments

Comments
 (0)