Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ numpy>=1.14
requests>=2.31
tenacity>=8.2.3 # only used in cheat() -> move to tests?
tqdm>=4.66.2
playwright==1.53.0
1 change: 0 additions & 1 deletion src/browsergym/workarena/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from .tasks.list import __TASKS__ as LIST_TASKS
from .tasks.navigation import __TASKS__ as NAVIGATION_TASKS
from .tasks.service_catalog import __TASKS__ as SERVICE_CATALOG_TASKS
from .tasks.compositional.base import CompositionalTask

ALL_WORKARENA_TASKS = [
*ALL_COMPOSITIONAL_TASKS_L2,
Expand Down
3 changes: 2 additions & 1 deletion src/browsergym/workarena/api/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from faker import Faker
import numpy as np
import time
import secrets

fake = Faker()

Expand Down Expand Up @@ -38,7 +39,7 @@ def create_user(

"""
user_idx = str(random.randint(1000, 9999))
user_password = "aStrongPassword!"
user_password = secrets.token_urlsafe(16)
first_name = fake.first_name() if not first_name else first_name
last_name = fake.last_name() if not last_name else last_name

Expand Down
13 changes: 8 additions & 5 deletions src/browsergym/workarena/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ def table_api_call(
if method == "POST" or wait_for_record:
while not record_exists:
sleep(0.5)
get_response = table_api_call(
instance=instance,
table=table,
get_response = requests.request(
method="GET",
url=instance.snow_url + f"/api/now/table/{table}",
auth=instance.snow_credentials,
headers=SNOW_API_HEADERS,
data=data,
params=params,
json=json,
data=data,
method="GET",
)
get_response.raise_for_status()
get_response = get_response.json()
record_exists = len(get_response["result"]) > 0
num_retries += 1
if num_retries > max_retries:
Expand Down