ExtractAction (#1632)

This commit is contained in:
Shuchang Zheng
2025-01-24 16:21:26 +08:00
committed by GitHub
parent 1c2425171f
commit b62a6fec23
10 changed files with 150 additions and 25 deletions

View File

@@ -27,6 +27,8 @@ class ActionType(StrEnum):
COMPLETE = "complete"
RELOAD_PAGE = "reload_page"
EXTRACT = "extract"
def is_web_action(self) -> bool:
return self in [
ActionType.CLICK,
@@ -248,6 +250,12 @@ class CompleteAction(DecisiveAction):
data_extraction_goal: str | None = None
class ExtractAction(Action):
action_type: ActionType = ActionType.EXTRACT
data_extraction_goal: str | None = None
data_extraction_schema: dict[str, Any] | None = None
class ScrapeResult(BaseModel):
"""
Scraped response from a webpage, including: