Skip to content

Commit

Permalink
descrease potential values to 5 from 10
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng committed Dec 9, 2024
1 parent d0e3564 commit 7df4c88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions skyvern/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SAVE_DOWNLOADED_FILES_TIMEOUT = 180
GET_DOWNLOADED_FILES_TIMEOUT = 30
NAVIGATION_MAX_RETRY_TIME = 5
AUTO_COMPLETION_POTENTIAL_VALUES_COUNT = 5

# reserved fields for navigation payload
SPECIAL_FIELD_VERIFICATION_CODE = "verification_code"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
You're doing an auto completion input action on HTML page. The current filled value doesn't match any option.
Based on the context, current value, user goal and user details, give ten most potential values with the same meaning as the current value.
Based on the context, current value, user goal and user details, give {{ potential_value_count }} most potential values with the same meaning as the current value.
You can provide values like:
- Subset or superset meaning from the current value
- Summarized from the current value
Expand Down
11 changes: 9 additions & 2 deletions skyvern/webeye/actions/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
from pydantic import BaseModel

from skyvern.config import settings
from skyvern.constants import BROWSER_DOWNLOAD_TIMEOUT, REPO_ROOT_DIR, SKYVERN_ID_ATTR
from skyvern.constants import (
AUTO_COMPLETION_POTENTIAL_VALUES_COUNT,
BROWSER_DOWNLOAD_TIMEOUT,
REPO_ROOT_DIR,
SKYVERN_ID_ATTR,
)
from skyvern.exceptions import (
EmptySelect,
ErrEmptyTweakValue,
Expand Down Expand Up @@ -1597,17 +1602,19 @@ async def input_or_auto_complete_input(

prompt = prompt_engine.load_prompt(
"auto-completion-potential-answers",
potential_value_count=AUTO_COMPLETION_POTENTIAL_VALUES_COUNT,
field_information=input_or_select_context.field,
current_value=current_value,
navigation_goal=task.navigation_goal,
navigation_payload_str=json.dumps(task.navigation_payload),
)

LOG.info(
"Ask LLM to give 10 potential values based on the current value",
"Ask LLM to give potential values based on the current value",
current_value=current_value,
step_id=step.step_id,
task_id=task.task_id,
potential_value_count=AUTO_COMPLETION_POTENTIAL_VALUES_COUNT,
)
json_respone = await app.SECONDARY_LLM_API_HANDLER(prompt=prompt, step=step)
values: list[dict] = json_respone.get("potential_values", [])
Expand Down

0 comments on commit 7df4c88

Please sign in to comment.