Skip to content

Commit 62761de

Browse files
committed
rc2
1 parent 032c387 commit 62761de

File tree

9 files changed

+18
-39
lines changed

9 files changed

+18
-39
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ while not done:
4343
obs, reward, terminated, truncated, info = env.step(action)
4444
```
4545

46-
47-
4846
### MiniWoB++ task example
4947

5048
Boilerplate code to run an agent on a miniwob task:
@@ -133,7 +131,3 @@ You can customize your experience by changing the `model_name` to your preferred
133131
_multiple agent demos on the open web, WorkArena and WebArena_
134132

135133
https://github.com/ServiceNow/BrowserGym/assets/26232819/e0bfc788-cc8e-44f1-b8c3-0d1114108b85
136-
137-
138-
139-

core/src/browsergym/core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0rc1"
1+
__version__ = "0.1.0rc2"
22

33
import playwright.sync_api
44

miniwob/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
browsergym-core==0.1.0rc1
1+
browsergym-core==0.1.0rc2

miniwob/src/browsergym/miniwob/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0rc1"
1+
__version__ = "0.1.0rc2"
22

33
from browsergym.core.registration import register_task
44

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ classifiers = [
2525
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2626
"License :: OSI Approved :: Apache Software License",
2727
]
28-
version="0.1.0rc1"
28+
version="0.1.0rc2"
2929
dependencies = [
30-
"browsergym-core==0.1.0rc1",
31-
"browsergym-miniwob==0.1.0rc1",
32-
"browsergym-webarena==0.1.0rc1",
33-
"browsergym-workarena==0.1.0rc1",
30+
"browsergym-core==0.1.0rc2",
31+
"browsergym-miniwob==0.1.0rc2",
32+
"browsergym-webarena==0.1.0rc2",
33+
"browsergym-workarena==0.1.0rc2",
3434
]
3535

3636
[tool.setuptools]

webarena/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
browsergym-core==0.1.0rc1
1+
browsergym-core==0.1.0rc2
22
libwebarena==0.0.2

webarena/src/browsergym/webarena/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0rc1"
1+
__version__ = "0.1.0rc2"
22

33
from browsergym.core.registration import register_task
44

webarena/src/browsergym/webarena/task.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ def setup(self, seed: int, page: playwright.sync_api.Page) -> tuple[str, dict]:
113113

114114
# This note is present in all webarena's agent prompts
115115
# https://github.com/web-arena-x/webarena/blob/c6475f0e9affe5252a2966e26b8cb4c834a4ae40/agent/prompts/raw/p_cot_id_actree_2s.py#L34
116-
goal += f"""
116+
if self.with_homepage_hint:
117+
goal += f"""
117118
118119
(Note: if you want to visit other websites, check out the homepage at {self.webarena_instance.home_url}. It has a list of websites you can visit. {self.webarena_instance.home_url}/password.html lists all the account name and password for the websites. You can use them to log in to the websites.)
119120
"""
120121

121122
# This note is present in some of webarena's agent prompts
122-
if self.with_na:
123+
if self.with_na_hint:
123124
goal += """\
124125
125126
If you believe the task is impossible to complete, provide the answer "N/A".
@@ -178,23 +179,3 @@ def validate(
178179
return score, True, "", {}
179180
else:
180181
return score, False, "", {}
181-
182-
def get_goal(self) -> str:
183-
goal = self.config["intent"]
184-
185-
if self.with_homepage_hint:
186-
goal += f"""
187-
188-
(Note: if you want to visit other websites, check out the homepage at {self.webarena_instance.home_url}. It has a list of websites you can visit. {self.webarena_instance.home_url}/password.html lists all the account name and password for the websites. You can use them to log in to the websites.)
189-
"""
190-
# This note is present in all webarena's agent prompts
191-
# https://github.com/web-arena-x/webarena/blob/c6475f0e9affe5252a2966e26b8cb4c834a4ae40/agent/prompts/raw/p_cot_id_actree_2s.py#L34
192-
193-
# This note is present in some of webarena's agent prompts
194-
if self.with_na_hint:
195-
goal += """\
196-
197-
If you believe the task is impossible to complete, provide the answer "N/A".
198-
"""
199-
200-
return goal

webarena/tests/test_env_general.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
import pytest
5+
import random
56

67
from tenacity import retry, stop_after_attempt, retry_if_exception_type
78

@@ -18,14 +19,17 @@
1819

1920
from browsergym.webarena import ALL_WEBARENA_TASK_IDS
2021

22+
rng = random.Random(1)
23+
task_ids = rng.sample(ALL_WEBARENA_TASK_IDS, 25)
24+
2125

2226
@retry(
2327
stop=stop_after_attempt(5),
2428
retry=retry_if_exception_type(TimeoutError),
2529
reraise=True,
2630
before_sleep=lambda _: logging.info("Retrying due to a TimeoutError..."),
2731
)
28-
@pytest.mark.parametrize("task_id", ALL_WEBARENA_TASK_IDS)
32+
@pytest.mark.parametrize("task_id", task_ids)
2933
@pytest.mark.slow
3034
def test_env_generic(task_id):
3135
env = gym.make(

0 commit comments

Comments
 (0)