CodeGen part1 - move ActionType to it's own py file (#2655)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
39
skyvern/webeye/actions/action_types.py
Normal file
39
skyvern/webeye/actions/action_types.py
Normal 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,
|
||||
]
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user