22
33from __future__ import annotations
44
5- from typing import TYPE_CHECKING , Any , Union , Mapping , TypeVar , cast
5+ from typing import TYPE_CHECKING , Any , Union
66from datetime import datetime
77from typing_extensions import Unpack , Literal
88
2424from .types .session_observe_response import SessionObserveResponse
2525from .types .session_navigate_response import SessionNavigateResponse
2626
27- TSessionParams = TypeVar ("TSessionParams" , bound = Mapping [str , Any ])
28-
29-
30- def _with_default_frame_id (params : TSessionParams ) -> TSessionParams :
31- prepared = dict (params )
32- if "frame_id" not in prepared :
33- prepared ["frame_id" ] = ""
34- return cast (TSessionParams , prepared )
35-
3627if TYPE_CHECKING :
3728 from ._client import Stagehand , AsyncStagehand
3829
@@ -62,7 +53,7 @@ def navigate(
6253 extra_query = extra_query ,
6354 extra_body = extra_body ,
6455 timeout = timeout ,
65- ** _with_default_frame_id ( params ) ,
56+ ** params ,
6657 )
6758
6859 def act (
@@ -80,7 +71,7 @@ def act(
8071 extra_query = extra_query ,
8172 extra_body = extra_body ,
8273 timeout = timeout ,
83- ** _with_default_frame_id ( params ) ,
74+ ** params ,
8475 )
8576
8677 def observe (
@@ -98,7 +89,7 @@ def observe(
9889 extra_query = extra_query ,
9990 extra_body = extra_body ,
10091 timeout = timeout ,
101- ** _with_default_frame_id ( params ) ,
92+ ** params ,
10293 )
10394
10495 def extract (
@@ -116,7 +107,7 @@ def extract(
116107 extra_query = extra_query ,
117108 extra_body = extra_body ,
118109 timeout = timeout ,
119- ** _with_default_frame_id ( params ) ,
110+ ** params ,
120111 )
121112
122113 def execute (
@@ -134,7 +125,7 @@ def execute(
134125 extra_query = extra_query ,
135126 extra_body = extra_body ,
136127 timeout = timeout ,
137- ** _with_default_frame_id ( params ) ,
128+ ** params ,
138129 )
139130
140131 def end (
@@ -182,7 +173,7 @@ async def navigate(
182173 extra_query = extra_query ,
183174 extra_body = extra_body ,
184175 timeout = timeout ,
185- ** _with_default_frame_id ( params ) ,
176+ ** params ,
186177 )
187178
188179 async def act (
@@ -200,7 +191,7 @@ async def act(
200191 extra_query = extra_query ,
201192 extra_body = extra_body ,
202193 timeout = timeout ,
203- ** _with_default_frame_id ( params ) ,
194+ ** params ,
204195 )
205196
206197 async def observe (
@@ -218,7 +209,7 @@ async def observe(
218209 extra_query = extra_query ,
219210 extra_body = extra_body ,
220211 timeout = timeout ,
221- ** _with_default_frame_id ( params ) ,
212+ ** params ,
222213 )
223214
224215 async def extract (
@@ -236,7 +227,7 @@ async def extract(
236227 extra_query = extra_query ,
237228 extra_body = extra_body ,
238229 timeout = timeout ,
239- ** _with_default_frame_id ( params ) ,
230+ ** params ,
240231 )
241232
242233 async def execute (
@@ -254,7 +245,7 @@ async def execute(
254245 extra_query = extra_query ,
255246 extra_body = extra_body ,
256247 timeout = timeout ,
257- ** _with_default_frame_id ( params ) ,
248+ ** params ,
258249 )
259250
260251 async def end (
0 commit comments