3434 BrowserRoutingConfig ,
3535 strip_direct_vm_auth ,
3636 rewrite_direct_vm_options ,
37+ browser_routing_config_from_env ,
3738)
3839
3940if TYPE_CHECKING :
7071 "Transport" ,
7172 "ProxiesTypes" ,
7273 "RequestOptions" ,
73- "BrowserRoutingConfig" ,
7474 "Kernel" ,
7575 "AsyncKernel" ,
7676 "Client" ,
@@ -89,7 +89,7 @@ class Kernel(SyncAPIClient):
8989 browser_route_cache : BrowserRouteCache
9090
9191 _environment : Literal ["production" , "development" ] | NotGiven
92- _browser_routing : BrowserRoutingConfig | None
92+ _browser_routing : BrowserRoutingConfig
9393
9494 def __init__ (
9595 self ,
@@ -101,7 +101,6 @@ def __init__(
101101 max_retries : int = DEFAULT_MAX_RETRIES ,
102102 default_headers : Mapping [str , str ] | None = None ,
103103 default_query : Mapping [str , object ] | None = None ,
104- browser_routing : BrowserRoutingConfig | None = None ,
105104 # Configure a custom httpx client.
106105 # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`.
107106 # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details.
@@ -166,7 +165,7 @@ def __init__(
166165 _strict_response_validation = _strict_response_validation ,
167166 )
168167 self .browser_route_cache = _browser_route_cache or BrowserRouteCache ()
169- self ._browser_routing = browser_routing
168+ self ._browser_routing = browser_routing_config_from_env ()
170169
171170 @cached_property
172171 def deployments (self ) -> DeploymentsResource :
@@ -301,7 +300,6 @@ def copy(
301300 set_default_headers : Mapping [str , str ] | None = None ,
302301 default_query : Mapping [str , object ] | None = None ,
303302 set_default_query : Mapping [str , object ] | None = None ,
304- browser_routing : BrowserRoutingConfig | None = None ,
305303 _browser_route_cache : BrowserRouteCache | None = None ,
306304 _extra_kwargs : Mapping [str , Any ] = {},
307305 ) -> Self :
@@ -336,7 +334,6 @@ def copy(
336334 max_retries = max_retries if is_given (max_retries ) else self .max_retries ,
337335 default_headers = headers ,
338336 default_query = params ,
339- browser_routing = browser_routing if browser_routing is not None else self ._browser_routing ,
340337 _browser_route_cache = _browser_route_cache or self .browser_route_cache ,
341338 ** _extra_kwargs ,
342339 )
@@ -385,7 +382,7 @@ class AsyncKernel(AsyncAPIClient):
385382 browser_route_cache : BrowserRouteCache
386383
387384 _environment : Literal ["production" , "development" ] | NotGiven
388- _browser_routing : BrowserRoutingConfig | None
385+ _browser_routing : BrowserRoutingConfig
389386
390387 def __init__ (
391388 self ,
@@ -397,7 +394,6 @@ def __init__(
397394 max_retries : int = DEFAULT_MAX_RETRIES ,
398395 default_headers : Mapping [str , str ] | None = None ,
399396 default_query : Mapping [str , object ] | None = None ,
400- browser_routing : BrowserRoutingConfig | None = None ,
401397 # Configure a custom httpx client.
402398 # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`.
403399 # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details.
@@ -462,7 +458,7 @@ def __init__(
462458 _strict_response_validation = _strict_response_validation ,
463459 )
464460 self .browser_route_cache = _browser_route_cache or BrowserRouteCache ()
465- self ._browser_routing = browser_routing
461+ self ._browser_routing = browser_routing_config_from_env ()
466462
467463 @cached_property
468464 def deployments (self ) -> AsyncDeploymentsResource :
@@ -597,7 +593,6 @@ def copy(
597593 set_default_headers : Mapping [str , str ] | None = None ,
598594 default_query : Mapping [str , object ] | None = None ,
599595 set_default_query : Mapping [str , object ] | None = None ,
600- browser_routing : BrowserRoutingConfig | None = None ,
601596 _browser_route_cache : BrowserRouteCache | None = None ,
602597 _extra_kwargs : Mapping [str , Any ] = {},
603598 ) -> Self :
@@ -632,7 +627,6 @@ def copy(
632627 max_retries = max_retries if is_given (max_retries ) else self .max_retries ,
633628 default_headers = headers ,
634629 default_query = params ,
635- browser_routing = browser_routing if browser_routing is not None else self ._browser_routing ,
636630 _browser_route_cache = _browser_route_cache or self .browser_route_cache ,
637631 ** _extra_kwargs ,
638632 )
0 commit comments