Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UrlBlock - a block to navigate to a url #1461

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions skyvern/forge/sdk/workflow/models/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class BlockType(StrEnum):
LOGIN = "login"
WAIT = "wait"
FILE_DOWNLOAD = "file_download"
GOTO_URL = "goto_url"


class BlockStatus(StrEnum):
Expand Down Expand Up @@ -1801,6 +1802,11 @@ class FileDownloadBlock(BaseTaskBlock):
block_type: Literal[BlockType.FILE_DOWNLOAD] = BlockType.FILE_DOWNLOAD


class UrlBlock(BaseTaskBlock):
block_type: Literal[BlockType.GOTO_URL] = BlockType.GOTO_URL
url: str


BlockSubclasses = Union[
ForLoopBlock,
TaskBlock,
Expand All @@ -1817,5 +1823,6 @@ class FileDownloadBlock(BaseTaskBlock):
LoginBlock,
WaitBlock,
FileDownloadBlock,
UrlBlock,
]
BlockTypeVar = Annotated[BlockSubclasses, Field(discriminator="block_type")]
6 changes: 6 additions & 0 deletions skyvern/forge/sdk/workflow/models/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ class FileDownloadBlockYAML(BlockYAML):
cache_actions: bool = False


class UrlBlockYAML(BlockYAML):
block_type: Literal[BlockType.GOTO_URL] = BlockType.GOTO_URL # type: ignore
url: str


PARAMETER_YAML_SUBCLASSES = (
AWSSecretParameterYAML
| BitwardenLoginCredentialParameterYAML
Expand Down Expand Up @@ -337,6 +342,7 @@ class FileDownloadBlockYAML(BlockYAML):
| LoginBlockYAML
| WaitBlockYAML
| FileDownloadBlockYAML
| UrlBlockYAML
)
BLOCK_YAML_TYPES = Annotated[BLOCK_YAML_SUBCLASSES, Field(discriminator="block_type")]

Expand Down
Loading