2025-11-11 15:34:04 -07:00
|
|
|
import typing
|
2025-10-29 19:53:12 -06:00
|
|
|
from typing import Any
|
|
|
|
|
|
2024-07-29 14:20:58 -07:00
|
|
|
from skyvern.forge.sdk.forge_log import setup_logger
|
2025-11-20 05:16:16 +02:00
|
|
|
from skyvern.utils import setup_windows_event_loop_policy
|
2024-07-29 14:20:58 -07:00
|
|
|
|
2025-11-11 15:34:04 -07:00
|
|
|
if typing.TYPE_CHECKING:
|
|
|
|
|
from skyvern.library import Skyvern # noqa: E402
|
2025-11-20 05:16:16 +02:00
|
|
|
setup_windows_event_loop_policy()
|
2024-07-29 14:20:58 -07:00
|
|
|
setup_logger()
|
2025-03-16 15:46:34 -07:00
|
|
|
|
2025-10-29 19:53:12 -06:00
|
|
|
# noinspection PyUnresolvedReferences
|
2025-06-18 00:44:46 -07:00
|
|
|
__all__ = [
|
|
|
|
|
"Skyvern",
|
|
|
|
|
"SkyvernPage",
|
|
|
|
|
"RunContext",
|
2025-08-16 17:48:10 -07:00
|
|
|
"action",
|
|
|
|
|
"cached",
|
|
|
|
|
"download",
|
|
|
|
|
"extract",
|
2025-09-10 17:22:00 -07:00
|
|
|
"http_request",
|
|
|
|
|
"goto",
|
2025-08-16 17:48:10 -07:00
|
|
|
"login",
|
2025-09-26 23:27:29 -07:00
|
|
|
"loop",
|
2025-09-10 17:22:00 -07:00
|
|
|
"parse_file",
|
2025-10-08 10:21:45 -07:00
|
|
|
"parse_pdf",
|
2025-09-10 17:22:00 -07:00
|
|
|
"prompt",
|
2025-09-18 00:27:49 -07:00
|
|
|
"render_list",
|
2025-08-22 11:24:09 -07:00
|
|
|
"render_template",
|
2025-09-09 22:33:59 -07:00
|
|
|
"run_code",
|
2025-08-16 17:48:10 -07:00
|
|
|
"run_script",
|
|
|
|
|
"run_task",
|
2025-09-10 17:22:00 -07:00
|
|
|
"send_email",
|
2025-06-18 00:44:46 -07:00
|
|
|
"setup",
|
2025-09-12 13:01:17 -07:00
|
|
|
"upload_file",
|
2025-10-01 08:34:29 -07:00
|
|
|
"validate",
|
2025-08-16 17:48:10 -07:00
|
|
|
"wait",
|
2025-08-10 13:16:46 -07:00
|
|
|
"workflow",
|
2025-06-18 00:44:46 -07:00
|
|
|
]
|
2025-10-29 19:53:12 -06:00
|
|
|
|
|
|
|
|
_lazy_imports = {
|
|
|
|
|
"Skyvern": "skyvern.library",
|
|
|
|
|
"SkyvernPage": "skyvern.core.script_generations.skyvern_page",
|
|
|
|
|
"RunContext": "skyvern.core.script_generations.skyvern_page",
|
|
|
|
|
"setup": "skyvern.core.script_generations.run_initializer",
|
|
|
|
|
"cached": "skyvern.core.script_generations.workflow_wrappers",
|
|
|
|
|
"workflow": "skyvern.core.script_generations.workflow_wrappers",
|
|
|
|
|
"action": "skyvern.services.script_service",
|
|
|
|
|
"download": "skyvern.services.script_service",
|
|
|
|
|
"extract": "skyvern.services.script_service",
|
|
|
|
|
"http_request": "skyvern.services.script_service",
|
|
|
|
|
"goto": "skyvern.services.script_service",
|
|
|
|
|
"login": "skyvern.services.script_service",
|
|
|
|
|
"loop": "skyvern.services.script_service",
|
|
|
|
|
"parse_file": "skyvern.services.script_service",
|
|
|
|
|
"parse_pdf": "skyvern.services.script_service",
|
|
|
|
|
"prompt": "skyvern.services.script_service",
|
|
|
|
|
"render_list": "skyvern.services.script_service",
|
|
|
|
|
"render_template": "skyvern.services.script_service",
|
|
|
|
|
"run_code": "skyvern.services.script_service",
|
|
|
|
|
"run_script": "skyvern.services.script_service",
|
|
|
|
|
"run_task": "skyvern.services.script_service",
|
|
|
|
|
"send_email": "skyvern.services.script_service",
|
|
|
|
|
"upload_file": "skyvern.services.script_service",
|
|
|
|
|
"validate": "skyvern.services.script_service",
|
|
|
|
|
"wait": "skyvern.services.script_service",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
|
|
|
if name in _lazy_imports:
|
|
|
|
|
module_path = _lazy_imports[name]
|
|
|
|
|
from importlib import import_module # noqa: PLC0415
|
|
|
|
|
|
|
|
|
|
module = import_module(module_path)
|
|
|
|
|
|
|
|
|
|
# For attributes that need to be extracted from the module
|
|
|
|
|
if hasattr(module, name):
|
|
|
|
|
value = getattr(module, name)
|
|
|
|
|
else:
|
|
|
|
|
# For module-level imports like "app"
|
|
|
|
|
value = module
|
|
|
|
|
|
|
|
|
|
# Cache the imported value
|
|
|
|
|
globals()[name] = value
|
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|