Skip to content

Commit 618266f

Browse files
feat: Removed requiring x-language and x-sdk-version from openapi spec
1 parent 6a71238 commit 618266f

File tree

10 files changed

+20
-326
lines changed

10 files changed

+20
-326
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-39cd9547d16412cf0568f6ce2ad8d43805dffe65bde830beeff630b903ae3b38.yml
3-
openapi_spec_hash: 9cd7c9fefa686f9711392782d948470f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-1705ff86e7ec80d6be2ddbb0e3cbee821f3e95d68fa6a48c790f586e3470e678.yml
3+
openapi_spec_hash: cf0d4dad078a7f7c1256b437e349b911
44
config_hash: 3c21550e2c94cad4339d3093d794beb0

src/stagehand/resources/sessions.py

Lines changed: 16 additions & 238 deletions
Large diffs are not rendered by default.

src/stagehand/types/session_act_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ class SessionActParamsBase(TypedDict, total=False):
2222

2323
options: Options
2424

25-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
26-
"""Client SDK language"""
27-
28-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
29-
"""Version of the Stagehand SDK"""
30-
3125
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
3226
"""ISO timestamp when request was sent"""
3327

src/stagehand/types/session_end_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
class SessionEndParams(TypedDict, total=False):
1515
_force_body: Annotated[object, PropertyInfo(alias="_forceBody")]
1616

17-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
18-
"""Client SDK language"""
19-
20-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
21-
"""Version of the Stagehand SDK"""
22-
2317
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
2418
"""ISO timestamp when request was sent"""
2519

src/stagehand/types/session_execute_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ class SessionExecuteParamsBase(TypedDict, total=False):
2626
frame_id: Annotated[str, PropertyInfo(alias="frameId")]
2727
"""Target frame ID for the agent"""
2828

29-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
30-
"""Client SDK language"""
31-
32-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
33-
"""Version of the Stagehand SDK"""
34-
3529
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
3630
"""ISO timestamp when request was sent"""
3731

src/stagehand/types/session_extract_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ class SessionExtractParamsBase(TypedDict, total=False):
2424
schema: Dict[str, object]
2525
"""JSON Schema defining the structure of data to extract"""
2626

27-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
28-
"""Client SDK language"""
29-
30-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
31-
"""Version of the Stagehand SDK"""
32-
3327
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
3428
"""ISO timestamp when request was sent"""
3529

src/stagehand/types/session_navigate_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ class SessionNavigateParams(TypedDict, total=False):
2323
stream_response: Annotated[bool, PropertyInfo(alias="streamResponse")]
2424
"""Whether to stream the response via SSE"""
2525

26-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
27-
"""Client SDK language"""
28-
29-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
30-
"""Version of the Stagehand SDK"""
31-
3226
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
3327
"""ISO timestamp when request was sent"""
3428

src/stagehand/types/session_observe_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ class SessionObserveParamsBase(TypedDict, total=False):
2121

2222
options: Options
2323

24-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
25-
"""Client SDK language"""
26-
27-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
28-
"""Version of the Stagehand SDK"""
29-
3024
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
3125
"""ISO timestamp when request was sent"""
3226

src/stagehand/types/session_start_params.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ class SessionStartParams(TypedDict, total=False):
6161
wait_for_captcha_solves: Annotated[bool, PropertyInfo(alias="waitForCaptchaSolves")]
6262
"""Wait for captcha solves (deprecated, v2 only)"""
6363

64-
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
65-
"""Client SDK language"""
66-
67-
x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")]
68-
"""Version of the Stagehand SDK"""
69-
7064
x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")]
7165
"""ISO timestamp when request was sent"""
7266

tests/api_resources/test_sessions.py

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ def test_method_act_with_all_params_overload_1(self, client: Stagehand) -> None:
4848
"variables": {"username": "john_doe"},
4949
},
5050
stream_response=False,
51-
x_language="typescript",
52-
x_sdk_version="3.0.6",
5351
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
5452
x_stream_response="true",
5553
)
@@ -115,8 +113,6 @@ def test_method_act_with_all_params_overload_2(self, client: Stagehand) -> None:
115113
"timeout": 30000,
116114
"variables": {"username": "john_doe"},
117115
},
118-
x_language="typescript",
119-
x_sdk_version="3.0.6",
120116
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
121117
x_stream_response="true",
122118
)
@@ -174,8 +170,7 @@ def test_method_end(self, client: Stagehand) -> None:
174170
def test_method_end_with_all_params(self, client: Stagehand) -> None:
175171
session = client.sessions.end(
176172
id="c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123",
177-
x_language="typescript",
178-
x_sdk_version="3.0.6",
173+
_force_body={},
179174
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
180175
x_stream_response="true",
181176
)
@@ -245,8 +240,6 @@ def test_method_execute_with_all_params_overload_1(self, client: Stagehand) -> N
245240
},
246241
frame_id="frameId",
247242
stream_response=False,
248-
x_language="typescript",
249-
x_sdk_version="3.0.6",
250243
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
251244
x_stream_response="true",
252245
)
@@ -329,8 +322,6 @@ def test_method_execute_with_all_params_overload_2(self, client: Stagehand) -> N
329322
},
330323
stream_response=True,
331324
frame_id="frameId",
332-
x_language="typescript",
333-
x_sdk_version="3.0.6",
334325
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
335326
x_stream_response="true",
336327
)
@@ -406,8 +397,6 @@ def test_method_extract_with_all_params_overload_1(self, client: Stagehand) -> N
406397
},
407398
schema={"foo": "bar"},
408399
stream_response=False,
409-
x_language="typescript",
410-
x_sdk_version="3.0.6",
411400
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
412401
x_stream_response="true",
413402
)
@@ -470,8 +459,6 @@ def test_method_extract_with_all_params_overload_2(self, client: Stagehand) -> N
470459
"timeout": 30000,
471460
},
472461
schema={"foo": "bar"},
473-
x_language="typescript",
474-
x_sdk_version="3.0.6",
475462
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
476463
x_stream_response="true",
477464
)
@@ -535,8 +522,6 @@ def test_method_navigate_with_all_params(self, client: Stagehand) -> None:
535522
"wait_until": "networkidle",
536523
},
537524
stream_response=True,
538-
x_language="typescript",
539-
x_sdk_version="3.0.6",
540525
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
541526
x_stream_response="true",
542527
)
@@ -600,8 +585,6 @@ def test_method_observe_with_all_params_overload_1(self, client: Stagehand) -> N
600585
"timeout": 30000,
601586
},
602587
stream_response=False,
603-
x_language="typescript",
604-
x_sdk_version="3.0.6",
605588
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
606589
x_stream_response="true",
607590
)
@@ -663,8 +646,6 @@ def test_method_observe_with_all_params_overload_2(self, client: Stagehand) -> N
663646
"selector": "nav",
664647
"timeout": 30000,
665648
},
666-
x_language="typescript",
667-
x_sdk_version="3.0.6",
668649
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
669650
x_stream_response="true",
670651
)
@@ -797,8 +778,6 @@ def test_method_start_with_all_params(self, client: Stagehand) -> None:
797778
system_prompt="systemPrompt",
798779
verbose=1,
799780
wait_for_captcha_solves=True,
800-
x_language="typescript",
801-
x_sdk_version="3.0.6",
802781
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
803782
x_stream_response="true",
804783
)
@@ -858,8 +837,6 @@ async def test_method_act_with_all_params_overload_1(self, async_client: AsyncSt
858837
"variables": {"username": "john_doe"},
859838
},
860839
stream_response=False,
861-
x_language="typescript",
862-
x_sdk_version="3.0.6",
863840
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
864841
x_stream_response="true",
865842
)
@@ -925,8 +902,6 @@ async def test_method_act_with_all_params_overload_2(self, async_client: AsyncSt
925902
"timeout": 30000,
926903
"variables": {"username": "john_doe"},
927904
},
928-
x_language="typescript",
929-
x_sdk_version="3.0.6",
930905
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
931906
x_stream_response="true",
932907
)
@@ -984,8 +959,7 @@ async def test_method_end(self, async_client: AsyncStagehand) -> None:
984959
async def test_method_end_with_all_params(self, async_client: AsyncStagehand) -> None:
985960
session = await async_client.sessions.end(
986961
id="c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123",
987-
x_language="typescript",
988-
x_sdk_version="3.0.6",
962+
_force_body={},
989963
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
990964
x_stream_response="true",
991965
)
@@ -1055,8 +1029,6 @@ async def test_method_execute_with_all_params_overload_1(self, async_client: Asy
10551029
},
10561030
frame_id="frameId",
10571031
stream_response=False,
1058-
x_language="typescript",
1059-
x_sdk_version="3.0.6",
10601032
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
10611033
x_stream_response="true",
10621034
)
@@ -1139,8 +1111,6 @@ async def test_method_execute_with_all_params_overload_2(self, async_client: Asy
11391111
},
11401112
stream_response=True,
11411113
frame_id="frameId",
1142-
x_language="typescript",
1143-
x_sdk_version="3.0.6",
11441114
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
11451115
x_stream_response="true",
11461116
)
@@ -1216,8 +1186,6 @@ async def test_method_extract_with_all_params_overload_1(self, async_client: Asy
12161186
},
12171187
schema={"foo": "bar"},
12181188
stream_response=False,
1219-
x_language="typescript",
1220-
x_sdk_version="3.0.6",
12211189
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
12221190
x_stream_response="true",
12231191
)
@@ -1280,8 +1248,6 @@ async def test_method_extract_with_all_params_overload_2(self, async_client: Asy
12801248
"timeout": 30000,
12811249
},
12821250
schema={"foo": "bar"},
1283-
x_language="typescript",
1284-
x_sdk_version="3.0.6",
12851251
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
12861252
x_stream_response="true",
12871253
)
@@ -1345,8 +1311,6 @@ async def test_method_navigate_with_all_params(self, async_client: AsyncStagehan
13451311
"wait_until": "networkidle",
13461312
},
13471313
stream_response=True,
1348-
x_language="typescript",
1349-
x_sdk_version="3.0.6",
13501314
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
13511315
x_stream_response="true",
13521316
)
@@ -1410,8 +1374,6 @@ async def test_method_observe_with_all_params_overload_1(self, async_client: Asy
14101374
"timeout": 30000,
14111375
},
14121376
stream_response=False,
1413-
x_language="typescript",
1414-
x_sdk_version="3.0.6",
14151377
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
14161378
x_stream_response="true",
14171379
)
@@ -1473,8 +1435,6 @@ async def test_method_observe_with_all_params_overload_2(self, async_client: Asy
14731435
"selector": "nav",
14741436
"timeout": 30000,
14751437
},
1476-
x_language="typescript",
1477-
x_sdk_version="3.0.6",
14781438
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
14791439
x_stream_response="true",
14801440
)
@@ -1607,8 +1567,6 @@ async def test_method_start_with_all_params(self, async_client: AsyncStagehand)
16071567
system_prompt="systemPrompt",
16081568
verbose=1,
16091569
wait_for_captcha_solves=True,
1610-
x_language="typescript",
1611-
x_sdk_version="3.0.6",
16121570
x_sent_at=parse_datetime("2025-01-15T10:30:00Z"),
16131571
x_stream_response="true",
16141572
)

0 commit comments

Comments
 (0)