Skip to content

Commit 2bdeae8

Browse files
feat: STG-1756 add Vertex auth params to Stagehand spec
1 parent 7b0a9a6 commit 2bdeae8

3 files changed

Lines changed: 457 additions & 5 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/stagehand-eae8400fade7b2c8329c4148f56de92e147c34c0feecb420c015aab6544a9acc.yml
3-
openapi_spec_hash: 0a9eff1ac1d464e89cbd9db64709b08a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-e77d6b15f0a94b16a54ef87a84d2cabe49eb11cff5ceba76f00dd788ff483eab.yml
3+
openapi_spec_hash: a1dab7fe72a772d188a15305124ebd73
44
config_hash: 1fb12ae9b478488bc1e56bfbdc210b01

src/stagehand/types/model_config_param.py

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,55 @@
22

33
from __future__ import annotations
44

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

8+
from .._types import SequenceNotStr
89
from .._utils import PropertyInfo
910

10-
__all__ = ["ModelConfigParam"]
11+
__all__ = ["ModelConfigParam", "GoogleAuthOptions", "GoogleAuthOptionsCredentials"]
12+
13+
14+
class GoogleAuthOptionsCredentials(TypedDict, total=False):
15+
"""Google Cloud service account credentials"""
16+
17+
client_email: Required[str]
18+
19+
private_key: Required[str]
20+
21+
auth_provider_x509_cert_url: str
22+
23+
auth_uri: str
24+
25+
client_id: str
26+
27+
client_x509_cert_url: str
28+
29+
private_key_id: str
30+
31+
project_id: str
32+
33+
token_uri: str
34+
35+
type: Literal["service_account"]
36+
37+
universe_domain: str
38+
39+
40+
class GoogleAuthOptions(TypedDict, total=False):
41+
"""google-auth-library options used to authenticate Vertex AI models"""
42+
43+
credentials: GoogleAuthOptionsCredentials
44+
"""Google Cloud service account credentials"""
45+
46+
project_id: Annotated[str, PropertyInfo(alias="projectId")]
47+
"""Google Cloud project ID used by google-auth-library"""
48+
49+
scopes: Union[str, SequenceNotStr[str]]
50+
"""Google auth scopes for the desired API request"""
51+
52+
universe_domain: Annotated[str, PropertyInfo(alias="universeDomain")]
53+
"""Google Cloud universe domain"""
1154

1255

1356
class ModelConfigParam(TypedDict, total=False):
@@ -20,8 +63,17 @@ class ModelConfigParam(TypedDict, total=False):
2063
base_url: Annotated[str, PropertyInfo(alias="baseURL")]
2164
"""Base URL for the model provider"""
2265

66+
google_auth_options: Annotated[GoogleAuthOptions, PropertyInfo(alias="googleAuthOptions")]
67+
"""google-auth-library options used to authenticate Vertex AI models"""
68+
2369
headers: Dict[str, str]
2470
"""Custom headers sent with every request to the model provider"""
2571

26-
provider: Literal["openai", "anthropic", "google", "microsoft", "bedrock"]
72+
location: str
73+
"""Google Cloud location for Vertex AI models"""
74+
75+
project: str
76+
"""Google Cloud project ID for Vertex AI models"""
77+
78+
provider: Literal["openai", "anthropic", "google", "microsoft", "bedrock", "vertex"]
2779
"""AI provider for the model (or provide a baseURL endpoint instead)"""

0 commit comments

Comments
 (0)