integration with CUA (#2126)
This commit is contained in:
@@ -28,6 +28,9 @@ class ActionType(StrEnum):
|
||||
RELOAD_PAGE = "reload_page"
|
||||
|
||||
EXTRACT = "extract"
|
||||
SCROLL = "scroll"
|
||||
KEYPRESS = "keypress"
|
||||
TYPE = "type"
|
||||
|
||||
def is_web_action(self) -> bool:
|
||||
return self in [
|
||||
@@ -177,6 +180,9 @@ class ClickAction(WebAction):
|
||||
action_type: ActionType = ActionType.CLICK
|
||||
file_url: str | None = None
|
||||
download: bool = False
|
||||
x: int | None = None
|
||||
y: int | None = None
|
||||
button: str = "left"
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"ClickAction(element_id={self.element_id}, file_url={self.file_url}, download={self.download})"
|
||||
@@ -240,6 +246,7 @@ class CheckboxAction(WebAction):
|
||||
|
||||
class WaitAction(Action):
|
||||
action_type: ActionType = ActionType.WAIT
|
||||
seconds: int = 20
|
||||
|
||||
|
||||
class TerminateAction(DecisiveAction):
|
||||
@@ -258,6 +265,19 @@ class ExtractAction(Action):
|
||||
data_extraction_schema: dict[str, Any] | None = None
|
||||
|
||||
|
||||
class ScrollAction(Action):
|
||||
action_type: ActionType = ActionType.SCROLL
|
||||
x: int
|
||||
y: int
|
||||
scroll_x: int
|
||||
scroll_y: int
|
||||
|
||||
|
||||
class KeypressAction(Action):
|
||||
action_type: ActionType = ActionType.KEYPRESS
|
||||
keys: list[str] = []
|
||||
|
||||
|
||||
class ScrapeResult(BaseModel):
|
||||
"""
|
||||
Scraped response from a webpage, including:
|
||||
|
||||
Reference in New Issue
Block a user