Skip to content

Commit 4ee3a33

Browse files
committed
minor updates
1 parent 18afbde commit 4ee3a33

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

stagehand/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ class StagehandConfig(BaseModel):
5252
None, alias="modelApiKey", description="Model API key"
5353
)
5454
model_client_options: Optional[dict[str, Any]] = Field(
55-
None, alias="modelClientOptions", description="Configuration options for the language model client (i.e. api_base)",
55+
None,
56+
alias="modelClientOptions",
57+
description="Configuration options for the language model client (i.e. api_base)",
5658
)
5759
verbose: Optional[int] = Field(
5860
1,

stagehand/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171

7272
# Handle model-related settings
7373
self.model_client_options = self.config.model_client_options or {}
74-
self.model_api_key = self.config.model_api_key or self.model_client_options.get("apiKey") or os.getenv("MODEL_API_KEY")
74+
self.model_api_key = self.config.model_api_key or os.getenv("MODEL_API_KEY")
7575

7676
self.model_name = self.config.model_name
7777

@@ -92,6 +92,7 @@ def __init__(
9292
self.local_browser_launch_options = (
9393
self.config.local_browser_launch_options or {}
9494
)
95+
self.model_client_options["apiKey"] = self.model_api_key
9596

9697
# Handle browserbase session create params
9798
self.browserbase_session_create_params = make_serializable(

0 commit comments

Comments
 (0)