Skip to content

Commit 7a5e940

Browse files
authored
fix bug on api_url load from .env (#116)
1 parent 36d45e1 commit 7a5e940

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stagehand/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from typing import Any, Callable, Literal, Optional
23

34
from browserbase.types import SessionCreateParams as BrowserbaseSessionCreateParams
@@ -42,7 +43,7 @@ class StagehandConfig(BaseModel):
4243
None, alias="projectId", description="Browserbase project ID"
4344
)
4445
api_url: Optional[str] = Field(
45-
"https://api.stagehand.browserbase.com/v1",
46+
os.environ.get("STAGEHAND_API_URL", "https://api.stagehand.browserbase.com/v1"),
4647
alias="apiUrl",
4748
description="Stagehand API URL",
4849
)

stagehand/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767
self.config = config
6868

6969
# Handle non-config parameters
70-
self.api_url = self.config.api_url or os.getenv("STAGEHAND_API_URL")
70+
self.api_url = self.config.api_url
7171
self.model_api_key = self.config.model_api_key or os.getenv("MODEL_API_KEY")
7272
self.model_name = self.config.model_name
7373

0 commit comments

Comments
 (0)