Skip to content

Commit fb347d2

Browse files
feat: Replace default model used in server-v3 api spec examples
1 parent df277b8 commit fb347d2

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-bc309fd00fe0507f4cbe3bc77fa27d0fbffeaa6e71998778da34de42608a67e8.yml
3-
openapi_spec_hash: 1db1af5c1b068bba1d652102f4454668
4-
config_hash: d6c6f623d03971bdba921650e5eb7e5f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-b969ce378479c79ee64c05127c0ed6c6ce2edbee017ecd037242fb618a5ebc9f.yml
3+
openapi_spec_hash: a24aabaa5214effb679808b7f2be0ad4
4+
config_hash: a962ae71493deb11a1c903256fb25386

tests/api_resources/test_sessions.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_method_act_with_all_params_overload_1(self, client: Stagehand) -> None:
4444
frame_id="frameId",
4545
options={
4646
"model": {
47-
"model_name": "openai/gpt-5-nano",
47+
"model_name": "openai/gpt-5.4-mini",
4848
"api_key": "sk-some-openai-api-key",
4949
"base_url": "https://api.openai.com/v1",
5050
"headers": {"foo": "string"},
@@ -121,7 +121,7 @@ def test_method_act_with_all_params_overload_2(self, client: Stagehand) -> None:
121121
frame_id="frameId",
122122
options={
123123
"model": {
124-
"model_name": "openai/gpt-5-nano",
124+
"model_name": "openai/gpt-5.4-mini",
125125
"api_key": "sk-some-openai-api-key",
126126
"base_url": "https://api.openai.com/v1",
127127
"headers": {"foo": "string"},
@@ -250,15 +250,15 @@ def test_method_execute_with_all_params_overload_1(self, client: Stagehand) -> N
250250
agent_config={
251251
"cua": True,
252252
"execution_model": {
253-
"model_name": "openai/gpt-5-nano",
253+
"model_name": "openai/gpt-5.4-mini",
254254
"api_key": "sk-some-openai-api-key",
255255
"base_url": "https://api.openai.com/v1",
256256
"headers": {"foo": "string"},
257257
"provider": "openai",
258258
},
259259
"mode": "cua",
260260
"model": {
261-
"model_name": "openai/gpt-5-nano",
261+
"model_name": "openai/gpt-5.4-mini",
262262
"api_key": "sk-some-openai-api-key",
263263
"base_url": "https://api.openai.com/v1",
264264
"headers": {"foo": "string"},
@@ -348,15 +348,15 @@ def test_method_execute_with_all_params_overload_2(self, client: Stagehand) -> N
348348
agent_config={
349349
"cua": True,
350350
"execution_model": {
351-
"model_name": "openai/gpt-5-nano",
351+
"model_name": "openai/gpt-5.4-mini",
352352
"api_key": "sk-some-openai-api-key",
353353
"base_url": "https://api.openai.com/v1",
354354
"headers": {"foo": "string"},
355355
"provider": "openai",
356356
},
357357
"mode": "cua",
358358
"model": {
359-
"model_name": "openai/gpt-5-nano",
359+
"model_name": "openai/gpt-5.4-mini",
360360
"api_key": "sk-some-openai-api-key",
361361
"base_url": "https://api.openai.com/v1",
362362
"headers": {"foo": "string"},
@@ -444,7 +444,7 @@ def test_method_extract_with_all_params_overload_1(self, client: Stagehand) -> N
444444
instruction="Extract all product names and prices from the page",
445445
options={
446446
"model": {
447-
"model_name": "openai/gpt-5-nano",
447+
"model_name": "openai/gpt-5.4-mini",
448448
"api_key": "sk-some-openai-api-key",
449449
"base_url": "https://api.openai.com/v1",
450450
"headers": {"foo": "string"},
@@ -512,7 +512,7 @@ def test_method_extract_with_all_params_overload_2(self, client: Stagehand) -> N
512512
instruction="Extract all product names and prices from the page",
513513
options={
514514
"model": {
515-
"model_name": "openai/gpt-5-nano",
515+
"model_name": "openai/gpt-5.4-mini",
516516
"api_key": "sk-some-openai-api-key",
517517
"base_url": "https://api.openai.com/v1",
518518
"headers": {"foo": "string"},
@@ -642,7 +642,7 @@ def test_method_observe_with_all_params_overload_1(self, client: Stagehand) -> N
642642
instruction="Find all clickable navigation links",
643643
options={
644644
"model": {
645-
"model_name": "openai/gpt-5-nano",
645+
"model_name": "openai/gpt-5.4-mini",
646646
"api_key": "sk-some-openai-api-key",
647647
"base_url": "https://api.openai.com/v1",
648648
"headers": {"foo": "string"},
@@ -716,7 +716,7 @@ def test_method_observe_with_all_params_overload_2(self, client: Stagehand) -> N
716716
instruction="Find all clickable navigation links",
717717
options={
718718
"model": {
719-
"model_name": "openai/gpt-5-nano",
719+
"model_name": "openai/gpt-5.4-mini",
720720
"api_key": "sk-some-openai-api-key",
721721
"base_url": "https://api.openai.com/v1",
722722
"headers": {"foo": "string"},
@@ -827,15 +827,15 @@ def test_path_params_replay(self, client: Stagehand) -> None:
827827
@parametrize
828828
def test_method_start(self, client: Stagehand) -> None:
829829
session = client.sessions.start(
830-
model_name="openai/gpt-4o",
830+
model_name="openai/gpt-5.4-mini",
831831
)
832832
assert_matches_type(SessionStartResponse, session, path=["response"])
833833

834834
@pytest.mark.skip(reason="Mock server tests are disabled")
835835
@parametrize
836836
def test_method_start_with_all_params(self, client: Stagehand) -> None:
837837
session = client.sessions.start(
838-
model_name="openai/gpt-4o",
838+
model_name="openai/gpt-5.4-mini",
839839
act_timeout_ms=0,
840840
browser={
841841
"cdp_url": "ws://localhost:9222",
@@ -924,7 +924,7 @@ def test_method_start_with_all_params(self, client: Stagehand) -> None:
924924
@parametrize
925925
def test_raw_response_start(self, client: Stagehand) -> None:
926926
response = client.sessions.with_raw_response.start(
927-
model_name="openai/gpt-4o",
927+
model_name="openai/gpt-5.4-mini",
928928
)
929929

930930
assert response.is_closed is True
@@ -936,7 +936,7 @@ def test_raw_response_start(self, client: Stagehand) -> None:
936936
@parametrize
937937
def test_streaming_response_start(self, client: Stagehand) -> None:
938938
with client.sessions.with_streaming_response.start(
939-
model_name="openai/gpt-4o",
939+
model_name="openai/gpt-5.4-mini",
940940
) as response:
941941
assert not response.is_closed
942942
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -970,7 +970,7 @@ async def test_method_act_with_all_params_overload_1(self, async_client: AsyncSt
970970
frame_id="frameId",
971971
options={
972972
"model": {
973-
"model_name": "openai/gpt-5-nano",
973+
"model_name": "openai/gpt-5.4-mini",
974974
"api_key": "sk-some-openai-api-key",
975975
"base_url": "https://api.openai.com/v1",
976976
"headers": {"foo": "string"},
@@ -1047,7 +1047,7 @@ async def test_method_act_with_all_params_overload_2(self, async_client: AsyncSt
10471047
frame_id="frameId",
10481048
options={
10491049
"model": {
1050-
"model_name": "openai/gpt-5-nano",
1050+
"model_name": "openai/gpt-5.4-mini",
10511051
"api_key": "sk-some-openai-api-key",
10521052
"base_url": "https://api.openai.com/v1",
10531053
"headers": {"foo": "string"},
@@ -1176,15 +1176,15 @@ async def test_method_execute_with_all_params_overload_1(self, async_client: Asy
11761176
agent_config={
11771177
"cua": True,
11781178
"execution_model": {
1179-
"model_name": "openai/gpt-5-nano",
1179+
"model_name": "openai/gpt-5.4-mini",
11801180
"api_key": "sk-some-openai-api-key",
11811181
"base_url": "https://api.openai.com/v1",
11821182
"headers": {"foo": "string"},
11831183
"provider": "openai",
11841184
},
11851185
"mode": "cua",
11861186
"model": {
1187-
"model_name": "openai/gpt-5-nano",
1187+
"model_name": "openai/gpt-5.4-mini",
11881188
"api_key": "sk-some-openai-api-key",
11891189
"base_url": "https://api.openai.com/v1",
11901190
"headers": {"foo": "string"},
@@ -1274,15 +1274,15 @@ async def test_method_execute_with_all_params_overload_2(self, async_client: Asy
12741274
agent_config={
12751275
"cua": True,
12761276
"execution_model": {
1277-
"model_name": "openai/gpt-5-nano",
1277+
"model_name": "openai/gpt-5.4-mini",
12781278
"api_key": "sk-some-openai-api-key",
12791279
"base_url": "https://api.openai.com/v1",
12801280
"headers": {"foo": "string"},
12811281
"provider": "openai",
12821282
},
12831283
"mode": "cua",
12841284
"model": {
1285-
"model_name": "openai/gpt-5-nano",
1285+
"model_name": "openai/gpt-5.4-mini",
12861286
"api_key": "sk-some-openai-api-key",
12871287
"base_url": "https://api.openai.com/v1",
12881288
"headers": {"foo": "string"},
@@ -1370,7 +1370,7 @@ async def test_method_extract_with_all_params_overload_1(self, async_client: Asy
13701370
instruction="Extract all product names and prices from the page",
13711371
options={
13721372
"model": {
1373-
"model_name": "openai/gpt-5-nano",
1373+
"model_name": "openai/gpt-5.4-mini",
13741374
"api_key": "sk-some-openai-api-key",
13751375
"base_url": "https://api.openai.com/v1",
13761376
"headers": {"foo": "string"},
@@ -1438,7 +1438,7 @@ async def test_method_extract_with_all_params_overload_2(self, async_client: Asy
14381438
instruction="Extract all product names and prices from the page",
14391439
options={
14401440
"model": {
1441-
"model_name": "openai/gpt-5-nano",
1441+
"model_name": "openai/gpt-5.4-mini",
14421442
"api_key": "sk-some-openai-api-key",
14431443
"base_url": "https://api.openai.com/v1",
14441444
"headers": {"foo": "string"},
@@ -1568,7 +1568,7 @@ async def test_method_observe_with_all_params_overload_1(self, async_client: Asy
15681568
instruction="Find all clickable navigation links",
15691569
options={
15701570
"model": {
1571-
"model_name": "openai/gpt-5-nano",
1571+
"model_name": "openai/gpt-5.4-mini",
15721572
"api_key": "sk-some-openai-api-key",
15731573
"base_url": "https://api.openai.com/v1",
15741574
"headers": {"foo": "string"},
@@ -1642,7 +1642,7 @@ async def test_method_observe_with_all_params_overload_2(self, async_client: Asy
16421642
instruction="Find all clickable navigation links",
16431643
options={
16441644
"model": {
1645-
"model_name": "openai/gpt-5-nano",
1645+
"model_name": "openai/gpt-5.4-mini",
16461646
"api_key": "sk-some-openai-api-key",
16471647
"base_url": "https://api.openai.com/v1",
16481648
"headers": {"foo": "string"},
@@ -1753,15 +1753,15 @@ async def test_path_params_replay(self, async_client: AsyncStagehand) -> None:
17531753
@parametrize
17541754
async def test_method_start(self, async_client: AsyncStagehand) -> None:
17551755
session = await async_client.sessions.start(
1756-
model_name="openai/gpt-4o",
1756+
model_name="openai/gpt-5.4-mini",
17571757
)
17581758
assert_matches_type(SessionStartResponse, session, path=["response"])
17591759

17601760
@pytest.mark.skip(reason="Mock server tests are disabled")
17611761
@parametrize
17621762
async def test_method_start_with_all_params(self, async_client: AsyncStagehand) -> None:
17631763
session = await async_client.sessions.start(
1764-
model_name="openai/gpt-4o",
1764+
model_name="openai/gpt-5.4-mini",
17651765
act_timeout_ms=0,
17661766
browser={
17671767
"cdp_url": "ws://localhost:9222",
@@ -1850,7 +1850,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncStagehand)
18501850
@parametrize
18511851
async def test_raw_response_start(self, async_client: AsyncStagehand) -> None:
18521852
response = await async_client.sessions.with_raw_response.start(
1853-
model_name="openai/gpt-4o",
1853+
model_name="openai/gpt-5.4-mini",
18541854
)
18551855

18561856
assert response.is_closed is True
@@ -1862,7 +1862,7 @@ async def test_raw_response_start(self, async_client: AsyncStagehand) -> None:
18621862
@parametrize
18631863
async def test_streaming_response_start(self, async_client: AsyncStagehand) -> None:
18641864
async with async_client.sessions.with_streaming_response.start(
1865-
model_name="openai/gpt-4o",
1865+
model_name="openai/gpt-5.4-mini",
18661866
) as response:
18671867
assert not response.is_closed
18681868
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tests/test_client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
10091009
respx_mock.post("/v1/sessions/start").mock(side_effect=httpx.TimeoutException("Test timeout error"))
10101010

10111011
with pytest.raises(APITimeoutError):
1012-
client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__enter__()
1012+
client.sessions.with_streaming_response.start(model_name="openai/gpt-5.4-mini").__enter__()
10131013

10141014
assert _get_open_connections(client) == 0
10151015

@@ -1019,7 +1019,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
10191019
respx_mock.post("/v1/sessions/start").mock(return_value=httpx.Response(500))
10201020

10211021
with pytest.raises(APIStatusError):
1022-
client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__enter__()
1022+
client.sessions.with_streaming_response.start(model_name="openai/gpt-5.4-mini").__enter__()
10231023
assert _get_open_connections(client) == 0
10241024

10251025
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@@ -1048,7 +1048,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10481048

10491049
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
10501050

1051-
response = client.sessions.with_raw_response.start(model_name="openai/gpt-4o")
1051+
response = client.sessions.with_raw_response.start(model_name="openai/gpt-5.4-mini")
10521052

10531053
assert response.retries_taken == failures_before_success
10541054
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1073,7 +1073,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10731073
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
10741074

10751075
response = client.sessions.with_raw_response.start(
1076-
model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": Omit()}
1076+
model_name="openai/gpt-5.4-mini", extra_headers={"x-stainless-retry-count": Omit()}
10771077
)
10781078

10791079
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1098,7 +1098,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
10981098
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
10991099

11001100
response = client.sessions.with_raw_response.start(
1101-
model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": "42"}
1101+
model_name="openai/gpt-5.4-mini", extra_headers={"x-stainless-retry-count": "42"}
11021102
)
11031103

11041104
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -2063,7 +2063,7 @@ async def test_retrying_timeout_errors_doesnt_leak(
20632063
respx_mock.post("/v1/sessions/start").mock(side_effect=httpx.TimeoutException("Test timeout error"))
20642064

20652065
with pytest.raises(APITimeoutError):
2066-
await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__aenter__()
2066+
await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-5.4-mini").__aenter__()
20672067

20682068
assert _get_open_connections(async_client) == 0
20692069

@@ -2075,7 +2075,7 @@ async def test_retrying_status_errors_doesnt_leak(
20752075
respx_mock.post("/v1/sessions/start").mock(return_value=httpx.Response(500))
20762076

20772077
with pytest.raises(APIStatusError):
2078-
await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__aenter__()
2078+
await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-5.4-mini").__aenter__()
20792079
assert _get_open_connections(async_client) == 0
20802080

20812081
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@@ -2104,7 +2104,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
21042104

21052105
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
21062106

2107-
response = await client.sessions.with_raw_response.start(model_name="openai/gpt-4o")
2107+
response = await client.sessions.with_raw_response.start(model_name="openai/gpt-5.4-mini")
21082108

21092109
assert response.retries_taken == failures_before_success
21102110
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -2129,7 +2129,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
21292129
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
21302130

21312131
response = await client.sessions.with_raw_response.start(
2132-
model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": Omit()}
2132+
model_name="openai/gpt-5.4-mini", extra_headers={"x-stainless-retry-count": Omit()}
21332133
)
21342134

21352135
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -2154,7 +2154,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
21542154
respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler)
21552155

21562156
response = await client.sessions.with_raw_response.start(
2157-
model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": "42"}
2157+
model_name="openai/gpt-5.4-mini", extra_headers={"x-stainless-retry-count": "42"}
21582158
)
21592159

21602160
assert response.http_request.headers.get("x-stainless-retry-count") == "42"

0 commit comments

Comments
 (0)