CodeGen part1 - move ActionType to it's own py file (#2655)

This commit is contained in:
Shuchang Zheng
2025-06-09 20:21:43 -07:00
committed by GitHub
parent 7ef2b11f34
commit 7fa002c500
7 changed files with 47 additions and 43 deletions

View File

@@ -75,10 +75,10 @@ from skyvern.schemas.runs import CUA_ENGINES, CUA_RUN_TYPES, RunEngine
from skyvern.services import run_service
from skyvern.utils.image_resizer import Resolution
from skyvern.utils.prompt_engine import load_prompt_with_elements
from skyvern.webeye.actions.action_types import ActionType
from skyvern.webeye.actions.actions import (
Action,
ActionStatus,
ActionType,
CompleteAction,
CompleteVerifyResult,
DecisiveAction,

View File

@@ -5,7 +5,7 @@ from enum import StrEnum
from pydantic import BaseModel
from skyvern.webeye.actions.actions import ActionType
from skyvern.webeye.actions.action_types import ActionType
from skyvern.webeye.actions.models import AgentStepOutput

View File

@@ -0,0 +1,39 @@
from enum import StrEnum
class ActionType(StrEnum):
CLICK = "click"
INPUT_TEXT = "input_text"
UPLOAD_FILE = "upload_file"
# This action is not used in the current implementation. Click actions are used instead."
DOWNLOAD_FILE = "download_file"
SELECT_OPTION = "select_option"
CHECKBOX = "checkbox"
WAIT = "wait"
NULL_ACTION = "null_action"
SOLVE_CAPTCHA = "solve_captcha"
TERMINATE = "terminate"
COMPLETE = "complete"
RELOAD_PAGE = "reload_page"
EXTRACT = "extract"
VERIFICATION_CODE = "verification_code"
SCROLL = "scroll"
KEYPRESS = "keypress"
TYPE = "type"
MOVE = "move"
DRAG = "drag"
LEFT_MOUSE = "left_mouse"
def is_web_action(self) -> bool:
return self in [
ActionType.CLICK,
ActionType.INPUT_TEXT,
ActionType.UPLOAD_FILE,
ActionType.DOWNLOAD_FILE,
ActionType.SELECT_OPTION,
ActionType.CHECKBOX,
]

View File

@@ -6,48 +6,12 @@ import structlog
from litellm import ConfigDict
from pydantic import BaseModel, Field
from skyvern.webeye.actions.action_types import ActionType
LOG = structlog.get_logger()
T = TypeVar("T", bound="Action")
class ActionType(StrEnum):
CLICK = "click"
INPUT_TEXT = "input_text"
UPLOAD_FILE = "upload_file"
# This action is not used in the current implementation. Click actions are used instead."
DOWNLOAD_FILE = "download_file"
SELECT_OPTION = "select_option"
CHECKBOX = "checkbox"
WAIT = "wait"
NULL_ACTION = "null_action"
SOLVE_CAPTCHA = "solve_captcha"
TERMINATE = "terminate"
COMPLETE = "complete"
RELOAD_PAGE = "reload_page"
EXTRACT = "extract"
VERIFICATION_CODE = "verification_code"
SCROLL = "scroll"
KEYPRESS = "keypress"
TYPE = "type"
MOVE = "move"
DRAG = "drag"
LEFT_MOUSE = "left_mouse"
def is_web_action(self) -> bool:
return self in [
ActionType.CLICK,
ActionType.INPUT_TEXT,
ActionType.UPLOAD_FILE,
ActionType.DOWNLOAD_FILE,
ActionType.SELECT_OPTION,
ActionType.CHECKBOX,
]
class ActionStatus(StrEnum):
pending = "pending"
skipped = "skipped"

View File

@@ -5,7 +5,8 @@ from skyvern.forge import app
from skyvern.forge.prompts import prompt_engine
from skyvern.forge.sdk.models import Step
from skyvern.forge.sdk.schemas.tasks import Task
from skyvern.webeye.actions.actions import Action, ActionStatus, ActionType, SelectOption
from skyvern.webeye.actions.action_types import ActionType
from skyvern.webeye.actions.actions import Action, ActionStatus, SelectOption
from skyvern.webeye.scraper.scraper import ScrapedPage
LOG = structlog.get_logger()

View File

@@ -73,10 +73,10 @@ from skyvern.forge.sdk.services.bitwarden import BitwardenConstants
from skyvern.schemas.runs import CUA_RUN_TYPES
from skyvern.utils.prompt_engine import CheckPhoneNumberFormatResponse, load_prompt_with_elements
from skyvern.webeye.actions import actions
from skyvern.webeye.actions.action_types import ActionType
from skyvern.webeye.actions.actions import (
Action,
ActionStatus,
ActionType,
CheckboxAction,
ClickAction,
InputOrSelectContext,

View File

@@ -11,9 +11,9 @@ from skyvern.forge.prompts import prompt_engine
from skyvern.forge.sdk.models import Step
from skyvern.forge.sdk.schemas.tasks import Task
from skyvern.utils.image_resizer import Resolution, scale_coordinates
from skyvern.webeye.actions.action_types import ActionType
from skyvern.webeye.actions.actions import (
Action,
ActionType,
CheckboxAction,
ClickAction,
CompleteAction,