Skip to content

Commit 6e0b8a3

Browse files
feat: Fix browser pool sdk types
1 parent a297c4d commit 6e0b8a3

File tree

5 files changed

+73
-93
lines changed

5 files changed

+73
-93
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 89
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-13214b99e392aab631aa1ca99b6a51a58df81e34156d21b8d639bea779566123.yml
33
openapi_spec_hash: a88d175fc3980de3097ac1411d8dcbff
4-
config_hash: 7225e7b7e4695c81d7be26c7108b5494
4+
config_hash: 179f33af31ece83563163d5b3d751d13

api.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,7 @@ Methods:
259259
Types:
260260

261261
```python
262-
from kernel.types import (
263-
BrowserPool,
264-
BrowserPoolAcquireRequest,
265-
BrowserPoolReleaseRequest,
266-
BrowserPoolRequest,
267-
BrowserPoolUpdateRequest,
268-
BrowserPoolListResponse,
269-
BrowserPoolAcquireResponse,
270-
)
262+
from kernel.types import BrowserPool, BrowserPoolListResponse, BrowserPoolAcquireResponse
271263
```
272264

273265
Methods:

src/kernel/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from .browser_persistence import BrowserPersistence as BrowserPersistence
2323
from .proxy_create_params import ProxyCreateParams as ProxyCreateParams
2424
from .proxy_list_response import ProxyListResponse as ProxyListResponse
25-
from .browser_pool_request import BrowserPoolRequest as BrowserPoolRequest
2625
from .browser_create_params import BrowserCreateParams as BrowserCreateParams
2726
from .browser_delete_params import BrowserDeleteParams as BrowserDeleteParams
2827
from .browser_list_response import BrowserListResponse as BrowserListResponse

src/kernel/types/browser_pool.py

Lines changed: 71 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,79 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import List, Optional
44
from datetime import datetime
55

66
from .._models import BaseModel
7-
from .browser_pool_request import BrowserPoolRequest
7+
from .shared.browser_profile import BrowserProfile
8+
from .shared.browser_viewport import BrowserViewport
9+
from .shared.browser_extension import BrowserExtension
810

9-
__all__ = ["BrowserPool"]
11+
__all__ = ["BrowserPool", "BrowserPoolConfig"]
12+
13+
14+
class BrowserPoolConfig(BaseModel):
15+
"""Configuration used to create all browsers in this pool"""
16+
17+
size: int
18+
"""Number of browsers to create in the pool"""
19+
20+
extensions: Optional[List[BrowserExtension]] = None
21+
"""List of browser extensions to load into the session.
22+
23+
Provide each by id or name.
24+
"""
25+
26+
fill_rate_per_minute: Optional[int] = None
27+
"""Percentage of the pool to fill per minute. Defaults to 10%."""
28+
29+
headless: Optional[bool] = None
30+
"""If true, launches the browser using a headless image. Defaults to false."""
31+
32+
kiosk_mode: Optional[bool] = None
33+
"""
34+
If true, launches the browser in kiosk mode to hide address bar and tabs in live
35+
view.
36+
"""
37+
38+
name: Optional[str] = None
39+
"""Optional name for the browser pool. Must be unique within the organization."""
40+
41+
profile: Optional[BrowserProfile] = None
42+
"""Profile selection for the browser session.
43+
44+
Provide either id or name. If specified, the matching profile will be loaded
45+
into the browser session. Profiles must be created beforehand.
46+
"""
47+
48+
proxy_id: Optional[str] = None
49+
"""Optional proxy to associate to the browser session.
50+
51+
Must reference a proxy belonging to the caller's org.
52+
"""
53+
54+
stealth: Optional[bool] = None
55+
"""
56+
If true, launches the browser in stealth mode to reduce detection by anti-bot
57+
mechanisms.
58+
"""
59+
60+
timeout_seconds: Optional[int] = None
61+
"""
62+
Default idle timeout in seconds for browsers acquired from this pool before they
63+
are destroyed. Defaults to 600 seconds if not specified
64+
"""
65+
66+
viewport: Optional[BrowserViewport] = None
67+
"""Initial browser window size in pixels with optional refresh rate.
68+
69+
If omitted, image defaults apply (1920x1080@25). Only specific viewport
70+
configurations are supported. The server will reject unsupported combinations.
71+
Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25,
72+
1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will
73+
be automatically determined from the width and height if they match a supported
74+
configuration exactly. Note: Higher resolutions may affect the responsiveness of
75+
live view browser
76+
"""
1077

1178

1279
class BrowserPool(BaseModel):
@@ -21,7 +88,7 @@ class BrowserPool(BaseModel):
2188
available_count: int
2289
"""Number of browsers currently available in the pool"""
2390

24-
browser_pool_config: BrowserPoolRequest
91+
browser_pool_config: BrowserPoolConfig
2592
"""Configuration used to create all browsers in this pool"""
2693

2794
created_at: datetime

src/kernel/types/browser_pool_request.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)