Skip to content

Commit 1a919ad

Browse files
authored
Fix timeout when use api is true (#218)
* fix timeout param pass through from browserbase session create params when use api is true * formatting * add changeset
1 parent cb35254 commit 1a919ad

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stagehand": patch
3+
---
4+
5+
Pass api_timeout param to Stagehand API correctly

stagehand/api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ async def _create_session(self):
2727
else None
2828
)
2929

30+
# API requires timeout while python sdk uses api_timeout which is converted to apiTimeout
31+
if (
32+
browserbase_session_create_params
33+
and "apiTimeout" in browserbase_session_create_params
34+
):
35+
browserbase_session_create_params["timeout"] = (
36+
browserbase_session_create_params.pop("apiTimeout")
37+
)
38+
3039
payload = {
3140
"modelName": self.model_name,
3241
"verbose": 2 if self.verbose == 3 else self.verbose,

0 commit comments

Comments
 (0)