Skip to content
Open
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
5 changes: 5 additions & 0 deletions builders/workflow_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def navigate(self, url: str):
self.current_step = main_step
return self

def monitor_changes(self, enabled: bool = True):
"""Compare each successful run with the previous successful run."""
self.meta["compareRuns"] = enabled
return self

def click(self, selector: str):
return self._add_action("click", [selector])

Expand Down
2 changes: 2 additions & 0 deletions extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def extract(
llm_api_key: Optional[str] = None,
llm_base_url: Optional[str] = None,
robot_name: Optional[str] = None,
compare_runs: Optional[bool] = None,
) -> Robot:
"""Create an AI-powered extraction robot from a natural language prompt.

Expand All @@ -77,6 +78,7 @@ async def extract(
"url": url,
**{key: value for key, value in llm_options.items() if value is not None},
"robotName": robot_name,
**({"compareRuns": compare_runs} if compare_runs is not None else {}),
}
robot_data = await self.client.extract_with_llm(options)
robot = await self.client.get_robot(robot_data["robotId"])
Expand Down
3 changes: 3 additions & 0 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async def create(
llm_model: Optional[str] = None,
llm_api_key: Optional[str] = None,
llm_base_url: Optional[str] = None,
compare_runs: Optional[bool] = None,
) -> Robot:
"""
Create a scrape robot.
Expand All @@ -46,6 +47,8 @@ async def create(
}
if smart_queries:
meta["smartQueries"] = smart_queries.strip()
if compare_runs is not None:
meta["compareRuns"] = compare_runs

meta.update(build_llm_payload(llm_provider, llm_model, llm_api_key, llm_base_url))

Expand Down