Revert "feat: add SKYVERN_BASE_URL environment variable support for client base URL"

This reverts commit 8e414ae232.
This commit is contained in:
Prakash Maheshwaran
2025-06-05 04:44:53 -04:00
parent 8e414ae232
commit d0ea267ad1

View File

@@ -1,12 +1,8 @@
# This file was auto-generated by Fern from our API Definition.
import os
import typing
import logging
from .environment import SkyvernEnvironment
import httpx
logger = logging.getLogger(__name__)
from .core.client_wrapper import SyncClientWrapper
from .types.run_engine import RunEngine
from .types.proxy_location import ProxyLocation
@@ -46,9 +42,7 @@ class Skyvern:
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client. If omitted, the value
of the ``SKYVERN_BASE_URL`` environment variable is used when set; otherwise
it falls back to the selected ``environment``.
The base url to use for requests from the client.
environment : SkyvernEnvironment
The environment to use for requests from the client. from .environment import SkyvernEnvironment
@@ -1628,9 +1622,7 @@ class AsyncSkyvern:
Parameters
----------
base_url : typing.Optional[str]
The base url to use for requests from the client. If omitted, the value
of the ``SKYVERN_BASE_URL`` environment variable is used when set; otherwise
it falls back to the selected ``environment``.
The base url to use for requests from the client.
environment : SkyvernEnvironment
The environment to use for requests from the client. from .environment import SkyvernEnvironment
@@ -3361,16 +3353,8 @@ class AsyncSkyvern:
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str:
if base_url is not None:
logger.debug("Using explicit base_url: %s", base_url)
return base_url
env_base_url = os.getenv("SKYVERN_BASE_URL")
if env_base_url:
logger.debug("Using SKYVERN_BASE_URL from environment: %s", env_base_url)
return env_base_url
if environment is not None:
logger.debug("Using base_url from environment enum: %s", environment.value)
elif environment is not None:
return environment.value
raise Exception("Please pass in either base_url or environment to construct the client")
else:
raise Exception("Please pass in either base_url or environment to construct the client")