Skip to content

Commit

Permalink
parse yaml criterion to block (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng authored Dec 13, 2024
1 parent 01c28e9 commit 31c1993
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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 @@ -131,6 +131,8 @@ class TaskBlockYAML(BlockYAML):
totp_verification_url: str | None = None
totp_identifier: str | None = None
cache_actions: bool = False
complete_criterion: str | None = None
terminate_criterion: str | None = None


class ForLoopBlockYAML(BlockYAML):
Expand Down Expand Up @@ -253,6 +255,8 @@ class NavigationBlockYAML(BlockYAML):
totp_verification_url: str | None = None
totp_identifier: str | None = None
cache_actions: bool = False
complete_criterion: str | None = None
terminate_criterion: str | None = None


class ExtractionBlockYAML(BlockYAML):
Expand Down Expand Up @@ -281,6 +285,8 @@ class LoginBlockYAML(BlockYAML):
totp_verification_url: str | None = None
totp_identifier: str | None = None
cache_actions: bool = False
complete_criterion: str | None = None
terminate_criterion: str | None = None


class WaitBlockYAML(BlockYAML):
Expand Down
6 changes: 6 additions & 0 deletions skyvern/forge/sdk/workflow/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,8 @@ async def block_yaml_to_block(
totp_verification_url=block_yaml.totp_verification_url,
totp_identifier=block_yaml.totp_identifier,
cache_actions=block_yaml.cache_actions,
complete_criterion=block_yaml.complete_criterion,
terminate_criterion=block_yaml.terminate_criterion,
)
elif block_yaml.block_type == BlockType.FOR_LOOP:
loop_blocks = [
Expand Down Expand Up @@ -1481,6 +1483,8 @@ async def block_yaml_to_block(
totp_verification_url=block_yaml.totp_verification_url,
totp_identifier=block_yaml.totp_identifier,
cache_actions=block_yaml.cache_actions,
complete_criterion=block_yaml.complete_criterion,
terminate_criterion=block_yaml.terminate_criterion,
)

elif block_yaml.block_type == BlockType.EXTRACTION:
Expand Down Expand Up @@ -1523,6 +1527,8 @@ async def block_yaml_to_block(
totp_verification_url=block_yaml.totp_verification_url,
totp_identifier=block_yaml.totp_identifier,
cache_actions=block_yaml.cache_actions,
complete_criterion=block_yaml.complete_criterion,
terminate_criterion=block_yaml.terminate_criterion,
)

elif block_yaml.block_type == BlockType.WAIT:
Expand Down

0 comments on commit 31c1993

Please sign in to comment.