From d107a7563cf08a886c82a4e7cfe5d5499f69e074 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Thu, 1 May 2025 00:09:49 -0700 Subject: [PATCH] apply scroll_amount_multiplier (#2268) --- skyvern/constants.py | 1 + skyvern/webeye/actions/parse_actions.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/skyvern/constants.py b/skyvern/constants.py index 1415ccd8..d3afa40f 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 935104ab..ab8f599d 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(