parameterize data schema in workflow (#2903)
This commit is contained in:
@@ -392,7 +392,7 @@ class BaseTaskBlock(Block):
|
||||
terminate_criterion: str | None = None
|
||||
navigation_goal: str | None = None
|
||||
data_extraction_goal: str | None = None
|
||||
data_schema: dict[str, Any] | list | None = None
|
||||
data_schema: dict[str, Any] | list | str | None = None
|
||||
# error code to error description for the LLM
|
||||
error_code_mapping: dict[str, str] | None = None
|
||||
max_retries: int = 0
|
||||
@@ -454,6 +454,11 @@ class BaseTaskBlock(Block):
|
||||
self.data_extraction_goal, workflow_run_context
|
||||
)
|
||||
|
||||
if isinstance(self.data_schema, str):
|
||||
self.data_schema = self.format_block_parameter_template_from_workflow_run_context(
|
||||
self.data_schema, workflow_run_context
|
||||
)
|
||||
|
||||
if self.complete_criterion:
|
||||
self.complete_criterion = self.format_block_parameter_template_from_workflow_run_context(
|
||||
self.complete_criterion, workflow_run_context
|
||||
|
||||
@@ -138,7 +138,7 @@ class TaskBlockYAML(BlockYAML):
|
||||
engine: RunEngine = RunEngine.skyvern_v1
|
||||
navigation_goal: str | None = None
|
||||
data_extraction_goal: str | None = None
|
||||
data_schema: dict[str, Any] | list | None = None
|
||||
data_schema: dict[str, Any] | list | str | None = None
|
||||
error_code_mapping: dict[str, str] | None = None
|
||||
max_retries: int = 0
|
||||
max_steps_per_run: int | None = None
|
||||
@@ -308,7 +308,7 @@ class ExtractionBlockYAML(BlockYAML):
|
||||
url: str | None = None
|
||||
title: str = ""
|
||||
engine: RunEngine = RunEngine.skyvern_v1
|
||||
data_schema: dict[str, Any] | list | None = None
|
||||
data_schema: dict[str, Any] | list | str | None = None
|
||||
max_retries: int = 0
|
||||
max_steps_per_run: int | None = None
|
||||
parameter_keys: list[str] | None = None
|
||||
|
||||
Reference in New Issue
Block a user