Skip to content

Commit 6bc85d1

Browse files
feat(api): update via SDK Studio
1 parent 4db3b7f commit 6bc85d1

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
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: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b91d95f8e40f28d0e455d749b86c4d864ac15a264dcc2c5b317f626ff605ce2c.yml
3-
openapi_spec_hash: befc3a683593ad7d832cfa9f0db941aa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-4502c65bef0843a6ae96d23bba075433af6bab49b55b544b1522f63e7881c00c.yml
3+
openapi_spec_hash: 3e67b77bbc8cd6155b8f66f3271f2643
44
config_hash: c6bab7ac8da570a5abbcfb19db119b6b

src/kernel/resources/browsers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def create(
4949
*,
5050
invocation_id: str,
5151
persistence: BrowserPersistenceParam | NotGiven = NOT_GIVEN,
52+
stealth: bool | NotGiven = NOT_GIVEN,
5253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5354
# The extra values given here take precedence over values defined on the client or passed to this method.
5455
extra_headers: Headers | None = None,
@@ -64,6 +65,9 @@ def create(
6465
6566
persistence: Optional persistence configuration for the browser session.
6667
68+
stealth: If true, launches the browser in stealth mode to reduce detection by anti-bot
69+
mechanisms.
70+
6771
extra_headers: Send extra headers
6872
6973
extra_query: Add additional query parameters to the request
@@ -78,6 +82,7 @@ def create(
7882
{
7983
"invocation_id": invocation_id,
8084
"persistence": persistence,
85+
"stealth": stealth,
8186
},
8287
browser_create_params.BrowserCreateParams,
8388
),
@@ -237,6 +242,7 @@ async def create(
237242
*,
238243
invocation_id: str,
239244
persistence: BrowserPersistenceParam | NotGiven = NOT_GIVEN,
245+
stealth: bool | NotGiven = NOT_GIVEN,
240246
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
241247
# The extra values given here take precedence over values defined on the client or passed to this method.
242248
extra_headers: Headers | None = None,
@@ -252,6 +258,9 @@ async def create(
252258
253259
persistence: Optional persistence configuration for the browser session.
254260
261+
stealth: If true, launches the browser in stealth mode to reduce detection by anti-bot
262+
mechanisms.
263+
255264
extra_headers: Send extra headers
256265
257266
extra_query: Add additional query parameters to the request
@@ -266,6 +275,7 @@ async def create(
266275
{
267276
"invocation_id": invocation_id,
268277
"persistence": persistence,
278+
"stealth": stealth,
269279
},
270280
browser_create_params.BrowserCreateParams,
271281
),

src/kernel/types/browser_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ class BrowserCreateParams(TypedDict, total=False):
1515

1616
persistence: BrowserPersistenceParam
1717
"""Optional persistence configuration for the browser session."""
18+
19+
stealth: bool
20+
"""
21+
If true, launches the browser in stealth mode to reduce detection by anti-bot
22+
mechanisms.
23+
"""

tests/api_resources/test_browsers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None:
3535
browser = client.browsers.create(
3636
invocation_id="rr33xuugxj9h0bkf1rdt2bet",
3737
persistence={"id": "my-awesome-browser-for-user-1234"},
38+
stealth=True,
3839
)
3940
assert_matches_type(BrowserCreateResponse, browser, path=["response"])
4041

@@ -228,6 +229,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) ->
228229
browser = await async_client.browsers.create(
229230
invocation_id="rr33xuugxj9h0bkf1rdt2bet",
230231
persistence={"id": "my-awesome-browser-for-user-1234"},
232+
stealth=True,
231233
)
232234
assert_matches_type(BrowserCreateResponse, browser, path=["response"])
233235

0 commit comments

Comments
 (0)