Skip to content

Automate browser based workflows with AI

apply scroll_amount_multiplier (#2268)

Shuchang Zhengd107a7563cf0
diff --git a/skyvern/constants.py b/skyvern/constants.py
index 1415ccd8d..d3afa40f3 100644
--- a/skyvern/constants.py
+++ b/skyvern/constants.py
@@ -34,3 +34,4 @@ class ScrapeType(StrEnum):
SCRAPE_TYPE_ORDER = [ScrapeType.NORMAL, ScrapeType.NORMAL, ScrapeType.RELOAD]
DEFAULT_MAX_TOKENS = 100000
MAX_IMAGE_MESSAGES = 10
+SCROLL_AMOUNT_MULTIPLIER = 100
diff --git a/skyvern/webeye/actions/parse_actions.py b/skyvern/webeye/actions/parse_actions.py
index 935104ab6..ab8f599d3 100644
--- a/skyvern/webeye/actions/parse_actions.py
+++ b/skyvern/webeye/actions/parse_actions.py
@@ -4,6 +4,7 @@ import structlog
from openai.types.responses.response import Response as OpenAIResponse
from pydantic import ValidationError
+from skyvern.constants import SCROLL_AMOUNT_MULTIPLIER
from skyvern.exceptions import NoTOTPVerificationCodeFound, UnsupportedActionType
from skyvern.forge import app
from skyvern.forge.prompts import prompt_engine
@@ -552,15 +553,15 @@ async def parse_anthropic_actions(
scroll_amount = tool_call_input.get("scroll_amount")
if scroll_direction == "up":
scroll_x = 0
- scroll_y = -scroll_amount
+ scroll_y = -scroll_amount * SCROLL_AMOUNT_MULTIPLIER
elif scroll_direction == "down":
scroll_x = 0
- scroll_y = scroll_amount
+ scroll_y = scroll_amount * SCROLL_AMOUNT_MULTIPLIER
elif scroll_direction == "left":
- scroll_x = -scroll_amount
+ scroll_x = -scroll_amount * SCROLL_AMOUNT_MULTIPLIER
scroll_y = 0
elif scroll_direction == "right":
- scroll_x = scroll_amount
+ scroll_x = scroll_amount * SCROLL_AMOUNT_MULTIPLIER
scroll_y = 0
else:
LOG.warning(