Skip to content

Commit 610b8bf

Browse files
authored
Merge pull request #172 from ServiceNow/for-webarena-agent
For webarena agent
2 parents 85e1a5a + 54356e5 commit 610b8bf

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/agentlab/analyze/inspect_results.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from IPython.display import display
1515
from tqdm import tqdm
1616

17-
from agentlab.experiments.exp_utils import RESULTS_DIR
18-
1917
# TODO find a more portable way to code set_task_category_as_index at least
2018
# handle dynamic imports. We don't want to always import workarena
2119
# from browsergym.workarena import TASK_CATEGORY_MAP

src/agentlab/experiments/exp_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pathlib import Path
77
from time import sleep, time
88

9-
from browsergym.experiments.loop import ExpArgs, _move_old_exp, yield_all_exp_results
9+
from browsergym.experiments.loop import ExpArgs, yield_all_exp_results
1010
from tqdm import tqdm
1111

1212
logger = logging.getLogger(__name__) # Get logger based on module name

src/agentlab/llm/llm_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ def retry_multiple(
126126
"""
127127
tries = 0
128128
while tries < n_retry:
129-
answer_list = chat(messages, num_samples=num_samples)
129+
answer_list = chat(messages, n_samples=num_samples)
130130
# TODO: could we change this to not use inplace modifications ?
131-
messages.append(answer)
131+
if not isinstance(answer_list, list):
132+
answer_list = [answer_list]
133+
134+
# TODO taking the 1st hides the other generated answers in AgentXRay
135+
messages.append(answer_list[0])
132136
parsed_answers = []
133137
errors = []
134138
for answer in answer_list:

0 commit comments

Comments
 (0)