Skip to content

Commit 53cffc4

Browse files
feat: Add record_audio option to browser replay recording API
1 parent c9e1eb0 commit 53cffc4

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-3a1db7f11a92b28681929255ada59d2317ee4db98b5ff5aa6ce142a0664058b3.yml
3-
openapi_spec_hash: b3064eaa589ae2a84993686ad1a3ee43
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-33e46e6a0095c2ec39a51860ee4e133c5a21a80a90cbe9e52953c07e5e0295de.yml
3+
openapi_spec_hash: 4aa466b9af39768b65a44b68ae0d1f6e
44
config_hash: ede72e4ae65cc5a6d6927938b3455c46

src/kernel/resources/browsers/replays.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def start(
128128
*,
129129
framerate: int | Omit = omit,
130130
max_duration_in_seconds: int | Omit = omit,
131+
record_audio: bool | Omit = omit,
131132
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
132133
# The extra values given here take precedence over values defined on the client or passed to this method.
133134
extra_headers: Headers | None = None,
@@ -144,6 +145,9 @@ def start(
144145
145146
max_duration_in_seconds: Maximum recording duration in seconds.
146147
148+
record_audio: Record audio in addition to video. When false (the default), the recording is
149+
video-only.
150+
147151
extra_headers: Send extra headers
148152
149153
extra_query: Add additional query parameters to the request
@@ -160,6 +164,7 @@ def start(
160164
{
161165
"framerate": framerate,
162166
"max_duration_in_seconds": max_duration_in_seconds,
167+
"record_audio": record_audio,
163168
},
164169
replay_start_params.ReplayStartParams,
165170
),
@@ -305,6 +310,7 @@ async def start(
305310
*,
306311
framerate: int | Omit = omit,
307312
max_duration_in_seconds: int | Omit = omit,
313+
record_audio: bool | Omit = omit,
308314
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
309315
# The extra values given here take precedence over values defined on the client or passed to this method.
310316
extra_headers: Headers | None = None,
@@ -321,6 +327,9 @@ async def start(
321327
322328
max_duration_in_seconds: Maximum recording duration in seconds.
323329
330+
record_audio: Record audio in addition to video. When false (the default), the recording is
331+
video-only.
332+
324333
extra_headers: Send extra headers
325334
326335
extra_query: Add additional query parameters to the request
@@ -337,6 +346,7 @@ async def start(
337346
{
338347
"framerate": framerate,
339348
"max_duration_in_seconds": max_duration_in_seconds,
349+
"record_audio": record_audio,
340350
},
341351
replay_start_params.ReplayStartParams,
342352
),

src/kernel/types/browsers/replay_start_params.py

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

1717
max_duration_in_seconds: int
1818
"""Maximum recording duration in seconds."""
19+
20+
record_audio: bool
21+
"""Record audio in addition to video.
22+
23+
When false (the default), the recording is video-only.
24+
"""

tests/api_resources/browsers/test_replays.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def test_method_start_with_all_params(self, client: Kernel) -> None:
142142
id="id",
143143
framerate=1,
144144
max_duration_in_seconds=1,
145+
record_audio=True,
145146
)
146147
assert_matches_type(ReplayStartResponse, replay, path=["response"])
147148

@@ -354,6 +355,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncKernel) ->
354355
id="id",
355356
framerate=1,
356357
max_duration_in_seconds=1,
358+
record_audio=True,
357359
)
358360
assert_matches_type(ReplayStartResponse, replay, path=["response"])
359361

0 commit comments

Comments
 (0)