-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbrowser_create_params.py
More file actions
250 lines (189 loc) · 9.2 KB
/
Copy pathbrowser_create_params.py
File metadata and controls
250 lines (189 loc) · 9.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Dict, Iterable, Optional
from typing_extensions import Literal, TypedDict
from .tags_param import TagsParam
from .browser_memory_request import BrowserMemoryRequest
from .browser_proxy_config_param import BrowserProxyConfigParam
from .browser_network_config_param import BrowserNetworkConfigParam
from .shared_params.browser_profile import BrowserProfile
from .shared_params.browser_viewport import BrowserViewport
from .shared_params.browser_extension import BrowserExtension
from .browsers.browser_telemetry_categories_config_param import BrowserTelemetryCategoriesConfigParam
__all__ = [
"BrowserCreateParams",
"Telemetry",
"TelemetryExport",
"TelemetryExportOtlp",
"TelemetryExportOtlpDestination",
]
class BrowserCreateParams(TypedDict, total=False):
chrome_policy: Dict[str, object]
"""Custom Chrome enterprise policy overrides applied to this browser session.
Keys are Chrome enterprise policy names; values must match their expected types.
Blocked: kernel-managed policies (extensions, proxy, CDP/automation). See
https://chromeenterprise.google/policies/
"""
extensions: Iterable[BrowserExtension]
"""List of browser extensions to load into the session.
Provide each by id or name.
"""
gpu: bool
"""If true, enables GPU acceleration for the browser session.
Requires Start-Up or Enterprise plan and headless=false.
"""
headless: bool
"""If true, launches the browser using a headless image (no VNC/GUI).
Defaults to false.
"""
invocation_id: str
"""action invocation ID"""
kiosk_mode: bool
"""
If true, launches the browser in kiosk mode to hide address bar and tabs in live
view.
"""
memory: BrowserMemoryRequest
"""Memory for a headful, non-GPU browser session. Defaults to 8GiB."""
name: str
"""
Optional human-readable name for the browser session, used to find it later in
the dashboard. Must be unique among active sessions within the project. Can be
changed later via PATCH /browsers/{id_or_name}.
"""
network: BrowserNetworkConfigParam
"""Network configuration for the browser session.
Cannot be changed after creation.
"""
profile: BrowserProfile
"""Profile selection for the browser session.
Provide either id or name. If specified, the matching profile will be loaded
into the browser session. Profiles must be created beforehand.
"""
proxy: BrowserProxyConfigParam
"""Proxy configuration for the browser session.
Cannot be combined with proxy_id. Omit to use the browser default: stealth
browsers use Kernel's default stealth proxy, while non-stealth browsers use
direct egress. Set mode to direct to force direct egress regardless of stealth.
Set mode to default to explicitly use the browser default: Kernel's default
stealth proxy when stealth=true, or direct egress when stealth=false. Select id
or name to use that proxy regardless of stealth. Proxy selection does not change
stealth or CAPTCHA solver behavior.
"""
proxy_id: str
"""Optional proxy to associate to the browser session.
Must reference a proxy in the same project as the browser session. Deprecated in
favor of proxy.
"""
region: Literal["us-east", "eu-west"]
"""Geographic region for the browser session.
It is fixed once the session is created. Region selection requires a Start-Up or
Enterprise plan, defaults to us-east when omitted on create.
"""
start_url: str
"""Optional URL to open when the browser session is created.
Navigation is best-effort, so navigation failures do not prevent the session
from being created.
"""
stealth: bool
"""If true, launches the browser in stealth mode and enables the CAPTCHA solver.
Defaults to false. When proxy is omitted, stealth browsers use Kernel's default
stealth proxy and non-stealth browsers use direct egress. An explicit proxy
configuration changes only egress; it does not enable or disable stealth or the
CAPTCHA solver.
"""
tags: TagsParam
"""
Optional user-defined key-value tags for the browser session, used to find and
group sessions later. Can be changed later via PATCH /browsers/{id_or_name}. Up
to 50 pairs.
"""
telemetry: Optional[Telemetry]
"""Telemetry configuration for the browser session.
Set enabled to true to start capture using VM defaults, or provide browser
category settings. If omitted, null, set to an empty object ({}), set to
enabled: false without browser category settings, or all four categories are
explicitly disabled, capture is not started.
"""
timeout_seconds: int
"""The number of seconds of inactivity before the browser session is terminated.
Activity includes CDP connections and live view connections. Defaults to 60
seconds. Minimum allowed is 10 seconds. Maximum allowed is 259200 (72 hours). We
check for inactivity every 5 seconds, so the actual timeout behavior you will
see is +/- 5 seconds around the specified value.
"""
viewport: BrowserViewport
"""
Initial browser window size in pixels with optional refresh rate. If omitted,
image defaults apply (1920x1080@25). For GPU images, the default is
1920x1080@60. Arbitrary viewport dimensions and refresh rates are accepted.
Known-good presets include: 2560x1440@10, 1920x1080@25, 1920x1200@25,
1440x900@25, 1280x800@60, 1024x768@60, 1200x800@60, 768x1024@60, 390x844@60. For
GPU images, recommended presets use one of these resolutions with refresh rates
60, 30, 25, or 10: 800x600, 960x720, 1024x576, 1024x768, 1152x648, 1200x800,
1280x720, 1368x768, 1440x900, 1600x900, 1920x1080, 1920x1200, 390x844, 360x250,
768x1024, 800x1600. Viewports outside this list may exhibit unstable live view
or recording behavior. If refresh_rate is not provided, it will be automatically
determined based on the resolution (higher resolutions use lower refresh rates
to keep bandwidth reasonable).
"""
class TelemetryExportOtlpDestination(TypedDict, total=False):
"""OTLP destination to export this session's captured telemetry to.
Provide either id or name. Requires telemetry capture to be enabled.
"""
id: str
"""OTLP destination ID"""
name: str
"""OTLP destination name"""
class TelemetryExportOtlp(TypedDict, total=False):
"""
Export captured telemetry over OTLP to one of the org's configured destinations.
"""
destination: TelemetryExportOtlpDestination
"""OTLP destination to export this session's captured telemetry to.
Provide either id or name. Requires telemetry capture to be enabled.
"""
enabled: bool
"""Whether to export captured telemetry over OTLP.
Setting destination implies enabled=true, so this only needs to be set
explicitly to disable export (enabled=false with a destination is rejected).
"""
class TelemetryExport(TypedDict, total=False):
"""Where to export this session's captured telemetry.
Omit to capture without exporting.
"""
otlp: TelemetryExportOtlp
"""
Export captured telemetry over OTLP to one of the org's configured destinations.
"""
class Telemetry(TypedDict, total=False):
"""Telemetry configuration for the browser session.
Set enabled to true to start capture using VM defaults, or provide browser category settings. If omitted, null, set to an empty object ({}), set to enabled: false without browser category settings, or all four categories are explicitly disabled, capture is not started.
"""
browser: BrowserTelemetryCategoriesConfigParam
"""Per-category capture flags.
The operational categories (control, connection, system, captcha) are captured
whenever telemetry is enabled; set one to enabled=false to opt out. The CDP
categories (console, network, page, interaction) and screenshot are off by
default; set enabled=true to opt in. On create, provided categories layer onto
the default set. On update, provided categories merge onto the session's current
config; when no telemetry is active this falls back to the default set (matching
create). If browser is omitted or empty, the default set is used. A browser
config that disables every category stops capture on update and starts no
capture on create.
"""
enabled: bool
"""Request shortcut for browser telemetry capture.
True enables capture; with no browser category settings it captures the default
set (control, connection, system, captcha), and any browser category settings
are layered onto that default set. On update, enabled=true resolves the config
fresh from the default set plus any provided categories, replacing the session's
current selection rather than merging onto it; omit enabled to merge categories
onto the current selection instead. False stops capture on update and starts no
capture on create. enabled=false cannot be combined with browser category
settings.
"""
export: TelemetryExport
"""Where to export this session's captured telemetry.
Omit to capture without exporting.
"""