Skip to content

Commit 0735b45

Browse files
feat: Add GPU viewport presets and GPU encoder defaults
1 parent c6f6862 commit 0735b45

15 files changed

+188
-116
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: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e6936890166ce5b11abaccd511a43a8807e2abf96c1f542d4f8d94655ef27d1f.yml
3-
openapi_spec_hash: 0146ecaea96d8136ef4a35cd04aacf22
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-95bb1cbe27cbed0339067fa133590e675b99cda4a9c04fad802a5b14563eb572.yml
3+
openapi_spec_hash: 3a24e61711eedb9ea7bb7589a7df956f
44
config_hash: cff4d43372b6fa66b64e2d4150f6aa76

src/kernel/resources/browser_pools.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,13 @@ def create(
110110
are destroyed. Defaults to 600 seconds if not specified
111111
112112
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
113-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
114-
but the following configurations are known-good and fully tested: 2560x1440@10,
115-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
113+
image defaults apply (1920x1080@25). For GPU images, the default is
114+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
115+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
116+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
117+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
118+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
119+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
116120
Viewports outside this list may exhibit unstable live view or recording
117121
behavior. If refresh_rate is not provided, it will be automatically determined
118122
based on the resolution (higher resolutions use lower refresh rates to keep
@@ -242,9 +246,13 @@ def update(
242246
are destroyed. Defaults to 600 seconds if not specified
243247
244248
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
245-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
246-
but the following configurations are known-good and fully tested: 2560x1440@10,
247-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
249+
image defaults apply (1920x1080@25). For GPU images, the default is
250+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
251+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
252+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
253+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
254+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
255+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
248256
Viewports outside this list may exhibit unstable live view or recording
249257
behavior. If refresh_rate is not provided, it will be automatically determined
250258
based on the resolution (higher resolutions use lower refresh rates to keep
@@ -550,9 +558,13 @@ async def create(
550558
are destroyed. Defaults to 600 seconds if not specified
551559
552560
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
553-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
554-
but the following configurations are known-good and fully tested: 2560x1440@10,
555-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
561+
image defaults apply (1920x1080@25). For GPU images, the default is
562+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
563+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
564+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
565+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
566+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
567+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
556568
Viewports outside this list may exhibit unstable live view or recording
557569
behavior. If refresh_rate is not provided, it will be automatically determined
558570
based on the resolution (higher resolutions use lower refresh rates to keep
@@ -682,9 +694,13 @@ async def update(
682694
are destroyed. Defaults to 600 seconds if not specified
683695
684696
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
685-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
686-
but the following configurations are known-good and fully tested: 2560x1440@10,
687-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
697+
image defaults apply (1920x1080@25). For GPU images, the default is
698+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
699+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
700+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
701+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
702+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
703+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
688704
Viewports outside this list may exhibit unstable live view or recording
689705
behavior. If refresh_rate is not provided, it will be automatically determined
690706
based on the resolution (higher resolutions use lower refresh rates to keep

src/kernel/resources/browsers/browsers.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,13 @@ def create(
196196
see is +/- 5 seconds around the specified value.
197197
198198
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
199-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
200-
but the following configurations are known-good and fully tested: 2560x1440@10,
201-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
199+
image defaults apply (1920x1080@25). For GPU images, the default is
200+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
201+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
202+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
203+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
204+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
205+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
202206
Viewports outside this list may exhibit unstable live view or recording
203207
behavior. If refresh_rate is not provided, it will be automatically determined
204208
based on the resolution (higher resolutions use lower refresh rates to keep
@@ -623,9 +627,13 @@ async def create(
623627
see is +/- 5 seconds around the specified value.
624628
625629
viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
626-
image defaults apply (1920x1080@25). Arbitrary viewport dimensions are accepted,
627-
but the following configurations are known-good and fully tested: 2560x1440@10,
628-
1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60.
630+
image defaults apply (1920x1080@25). For GPU images, the default is
631+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
632+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
633+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
634+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
635+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
636+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
629637
Viewports outside this list may exhibit unstable live view or recording
630638
behavior. If refresh_rate is not provided, it will be automatically determined
631639
based on the resolution (higher resolutions use lower refresh rates to keep

src/kernel/types/browser_create_params.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,17 @@ class BrowserCreateParams(TypedDict, total=False):
7373
"""
7474

7575
viewport: BrowserViewport
76-
"""Initial browser window size in pixels with optional refresh rate.
77-
78-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
79-
are accepted, but the following configurations are known-good and fully tested:
80-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
81-
1200x800@60. Viewports outside this list may exhibit unstable live view or
82-
recording behavior. If refresh_rate is not provided, it will be automatically
83-
determined based on the resolution (higher resolutions use lower refresh rates
84-
to keep bandwidth reasonable).
76+
"""
77+
Initial browser window size in pixels with optional refresh rate. If omitted,
78+
image defaults apply (1920x1080@25). For GPU images, the default is
79+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
80+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
81+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
82+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
83+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
84+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
85+
Viewports outside this list may exhibit unstable live view or recording
86+
behavior. If refresh_rate is not provided, it will be automatically determined
87+
based on the resolution (higher resolutions use lower refresh rates to keep
88+
bandwidth reasonable).
8589
"""

src/kernel/types/browser_create_response.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ class BrowserCreateResponse(BaseModel):
6666
"""Session usage metrics."""
6767

6868
viewport: Optional[BrowserViewport] = None
69-
"""Initial browser window size in pixels with optional refresh rate.
70-
71-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
72-
are accepted, but the following configurations are known-good and fully tested:
73-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
74-
1200x800@60. Viewports outside this list may exhibit unstable live view or
75-
recording behavior. If refresh_rate is not provided, it will be automatically
76-
determined based on the resolution (higher resolutions use lower refresh rates
77-
to keep bandwidth reasonable).
69+
"""
70+
Initial browser window size in pixels with optional refresh rate. If omitted,
71+
image defaults apply (1920x1080@25). For GPU images, the default is
72+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
73+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
74+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
75+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
76+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
77+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
78+
Viewports outside this list may exhibit unstable live view or recording
79+
behavior. If refresh_rate is not provided, it will be automatically determined
80+
based on the resolution (higher resolutions use lower refresh rates to keep
81+
bandwidth reasonable).
7882
"""

src/kernel/types/browser_list_response.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ class BrowserListResponse(BaseModel):
6666
"""Session usage metrics."""
6767

6868
viewport: Optional[BrowserViewport] = None
69-
"""Initial browser window size in pixels with optional refresh rate.
70-
71-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
72-
are accepted, but the following configurations are known-good and fully tested:
73-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
74-
1200x800@60. Viewports outside this list may exhibit unstable live view or
75-
recording behavior. If refresh_rate is not provided, it will be automatically
76-
determined based on the resolution (higher resolutions use lower refresh rates
77-
to keep bandwidth reasonable).
69+
"""
70+
Initial browser window size in pixels with optional refresh rate. If omitted,
71+
image defaults apply (1920x1080@25). For GPU images, the default is
72+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
73+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
74+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
75+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
76+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
77+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
78+
Viewports outside this list may exhibit unstable live view or recording
79+
behavior. If refresh_rate is not provided, it will be automatically determined
80+
based on the resolution (higher resolutions use lower refresh rates to keep
81+
bandwidth reasonable).
7882
"""

src/kernel/types/browser_pool.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,19 @@ class BrowserPoolConfig(BaseModel):
6868
"""
6969

7070
viewport: Optional[BrowserViewport] = None
71-
"""Initial browser window size in pixels with optional refresh rate.
72-
73-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
74-
are accepted, but the following configurations are known-good and fully tested:
75-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
76-
1200x800@60. Viewports outside this list may exhibit unstable live view or
77-
recording behavior. If refresh_rate is not provided, it will be automatically
78-
determined based on the resolution (higher resolutions use lower refresh rates
79-
to keep bandwidth reasonable).
71+
"""
72+
Initial browser window size in pixels with optional refresh rate. If omitted,
73+
image defaults apply (1920x1080@25). For GPU images, the default is
74+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
75+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
76+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
77+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
78+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
79+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
80+
Viewports outside this list may exhibit unstable live view or recording
81+
behavior. If refresh_rate is not provided, it will be automatically determined
82+
based on the resolution (higher resolutions use lower refresh rates to keep
83+
bandwidth reasonable).
8084
"""
8185

8286

src/kernel/types/browser_pool_acquire_response.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ class BrowserPoolAcquireResponse(BaseModel):
6666
"""Session usage metrics."""
6767

6868
viewport: Optional[BrowserViewport] = None
69-
"""Initial browser window size in pixels with optional refresh rate.
70-
71-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
72-
are accepted, but the following configurations are known-good and fully tested:
73-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
74-
1200x800@60. Viewports outside this list may exhibit unstable live view or
75-
recording behavior. If refresh_rate is not provided, it will be automatically
76-
determined based on the resolution (higher resolutions use lower refresh rates
77-
to keep bandwidth reasonable).
69+
"""
70+
Initial browser window size in pixels with optional refresh rate. If omitted,
71+
image defaults apply (1920x1080@25). For GPU images, the default is
72+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
73+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
74+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
75+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
76+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
77+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
78+
Viewports outside this list may exhibit unstable live view or recording
79+
behavior. If refresh_rate is not provided, it will be automatically determined
80+
based on the resolution (higher resolutions use lower refresh rates to keep
81+
bandwidth reasonable).
7882
"""

src/kernel/types/browser_pool_create_params.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,17 @@ class BrowserPoolCreateParams(TypedDict, total=False):
6767
"""
6868

6969
viewport: BrowserViewport
70-
"""Initial browser window size in pixels with optional refresh rate.
71-
72-
If omitted, image defaults apply (1920x1080@25). Arbitrary viewport dimensions
73-
are accepted, but the following configurations are known-good and fully tested:
74-
2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1280x800@60, 1024x768@60,
75-
1200x800@60. Viewports outside this list may exhibit unstable live view or
76-
recording behavior. If refresh_rate is not provided, it will be automatically
77-
determined based on the resolution (higher resolutions use lower refresh rates
78-
to keep bandwidth reasonable).
70+
"""
71+
Initial browser window size in pixels with optional refresh rate. If omitted,
72+
image defaults apply (1920x1080@25). For GPU images, the default is
73+
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
74+
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
75+
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60. For GPU images, recommended
76+
presets use one of these resolutions with refresh rates 60, 30, 25, or 10:
77+
800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800, 1280x720, 1368x768,
78+
1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250, 768x1024, 800x1600.
79+
Viewports outside this list may exhibit unstable live view or recording
80+
behavior. If refresh_rate is not provided, it will be automatically determined
81+
based on the resolution (higher resolutions use lower refresh rates to keep
82+
bandwidth reasonable).
7983
"""

0 commit comments

Comments
 (0)