-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathagent_configs.py
More file actions
351 lines (323 loc) · 10.2 KB
/
agent_configs.py
File metadata and controls
351 lines (323 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
"""
Basic flags and agent configurations for generic agents.
"""
import bgym
from agentlab.agents import dynamic_prompting as dp
from agentlab.experiments import args
from agentlab.llm.llm_configs import CHAT_MODEL_ARGS_DICT
from .generic_agent import GenericAgentArgs
from .generic_agent_prompt import GenericPromptFlags
from .tmlr_config import BASE_FLAGS
FLAGS_CUSTOM = GenericPromptFlags(
obs=dp.ObsFlags(
use_html=False,
use_ax_tree=True,
use_focused_element=True,
use_error_logs=True,
use_history=True,
use_past_error_logs=False,
use_action_history=True,
use_think_history=False,
use_diff=False,
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=True,
extract_clickable_tag=False,
extract_coords="False",
filter_visible_elements_only=False,
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=["bid"],
multiaction=False,
),
long_description=False,
individual_examples=True,
),
use_plan=False,
use_criticise=False,
use_thinking=True,
use_memory=False,
use_concrete_example=True,
use_abstract_example=True,
use_hints=True,
enable_chat=False,
max_prompt_tokens=40_000,
be_cautious=True,
extra_instructions=None,
)
AGENT_CUSTOM = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-3.1-8b-instruct"],
flags=FLAGS_CUSTOM,
)
# GPT-3.5 default config
FLAGS_GPT_3_5 = GenericPromptFlags(
obs=dp.ObsFlags(
use_html=False, # too big for most benchmark except miniwob
use_ax_tree=True, # very useful
use_focused_element=True, # detrimental on minowob according to ablation study
use_error_logs=True,
use_history=True,
use_past_error_logs=False, # very detrimental on L1 and miniwob
use_action_history=True, # helpful on miniwob
use_think_history=False, # detrimental on L1 and miniwob
use_diff=False,
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=True, # doesn't change much
extract_clickable_tag=False, # doesn't change much
extract_coords="False",
filter_visible_elements_only=False,
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=["bid"],
multiaction=False,
),
long_description=False,
individual_examples=True,
),
use_plan=False, # usually detrimental
use_criticise=False, # usually detrimental
use_thinking=True, # very useful
use_memory=False,
use_concrete_example=True, # useful
use_abstract_example=True, # useful
use_hints=True, # useful
enable_chat=False,
max_prompt_tokens=40_000,
be_cautious=True,
extra_instructions=None,
)
AGENT_3_5 = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-3.5-turbo-1106"],
flags=FLAGS_GPT_3_5,
)
# llama3-70b default config
FLAGS_LLAMA3_70B = GenericPromptFlags(
obs=dp.ObsFlags(
use_html=False,
use_ax_tree=True,
use_focused_element=True,
use_error_logs=False,
use_history=True,
use_past_error_logs=False,
use_action_history=True,
use_think_history=True,
use_diff=False,
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=True,
extract_clickable_tag=False,
extract_coords="False",
filter_visible_elements_only=False,
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=["bid"],
multiaction=False,
),
long_description=False,
individual_examples=True,
),
use_plan=False,
use_criticise=False,
use_thinking=True,
use_memory=False,
use_concrete_example=True,
use_abstract_example=True,
use_hints=True,
enable_chat=False,
max_prompt_tokens=40_000,
be_cautious=True,
extra_instructions=None,
add_missparsed_messages=True,
)
AGENT_LLAMA3_70B = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-3-70b-instruct"],
flags=FLAGS_LLAMA3_70B,
)
AGENT_LLAMA31_70B = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-3.1-70b-instruct"],
flags=FLAGS_LLAMA3_70B,
)
FLAGS_8B = GenericPromptFlags(
obs=dp.ObsFlags(
use_html=False,
use_ax_tree=True,
use_focused_element=True,
use_error_logs=False,
use_history=True,
use_past_error_logs=False,
use_action_history=True,
use_think_history=False,
use_diff=False,
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=False,
extract_clickable_tag=False,
extract_coords="False",
filter_visible_elements_only=False,
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=["bid"],
multiaction=True,
),
long_description=False,
individual_examples=True,
),
use_plan=False,
use_criticise=False,
use_thinking=True,
use_memory=False,
use_concrete_example=True,
use_abstract_example=True,
use_hints=True,
enable_chat=False,
max_prompt_tokens=40_000,
be_cautious=True,
extra_instructions=None,
add_missparsed_messages=True,
)
AGENT_8B = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["meta-llama/Meta-Llama-3-8B-Instruct"],
flags=FLAGS_8B,
)
AGENT_LLAMA31_8B = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-3.1-8b-instruct"],
flags=FLAGS_8B,
)
# GPT-4o default config
FLAGS_GPT_4o = GenericPromptFlags(
obs=dp.ObsFlags(
use_html=False,
use_ax_tree=True,
use_focused_element=True,
use_error_logs=True,
use_history=True,
use_past_error_logs=False,
use_action_history=True,
use_think_history=False,
use_diff=False,
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=True,
extract_clickable_tag=True,
extract_coords="False",
filter_visible_elements_only=False,
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=["bid"],
multiaction=False,
),
long_description=False,
individual_examples=False,
),
use_plan=False,
use_criticise=False,
use_thinking=True,
use_memory=False,
use_concrete_example=True,
use_abstract_example=True,
use_hints=True,
enable_chat=False,
max_prompt_tokens=40_000,
be_cautious=True,
extra_instructions=None,
)
AGENT_4o = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-4o-2024-05-13"],
flags=FLAGS_GPT_4o,
)
AGENT_4o_MINI = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-4o-mini-2024-07-18"],
flags=FLAGS_GPT_4o,
)
AGENT_CLAUDE_SONNET_35 = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/anthropic/claude-3.5-sonnet:beta"],
flags=FLAGS_GPT_4o,
)
AGENT_37_SONNET = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/anthropic/claude-3.7-sonnet"],
flags=FLAGS_GPT_4o,
)
AGENT_o3_MINI = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/o3-mini-2025-01-31"],
flags=FLAGS_GPT_4o,
)
AGENT_o1_MINI = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/openai/o1-mini-2024-09-12"],
flags=FLAGS_GPT_4o,
)
# GPT-4o vision default config
FLAGS_GPT_4o_VISION = FLAGS_GPT_4o.copy()
FLAGS_GPT_4o_VISION.obs.use_screenshot = True
FLAGS_GPT_4o_VISION.obs.use_som = True
AGENT_4o_VISION = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-4o-2024-05-13"],
flags=FLAGS_GPT_4o_VISION,
)
AGENT_4o_MINI_VISION = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-4o-mini-2024-07-18"],
flags=FLAGS_GPT_4o_VISION,
)
AGENT_CLAUDE_SONNET_35_VISION = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/anthropic/claude-3.5-sonnet:beta"],
flags=FLAGS_GPT_4o_VISION,
)
AGENT_LLAMA4_17B_INSTRUCT = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openrouter/meta-llama/llama-4-maverick"],
flags=BASE_FLAGS,
)
DEFAULT_RS_FLAGS = GenericPromptFlags(
flag_group="default_rs",
obs=dp.ObsFlags(
use_html=True,
use_ax_tree=args.Choice([True, False]),
use_focused_element=False,
use_error_logs=True,
use_history=True,
use_past_error_logs=args.Choice([True, False], p=[0.7, 0.3]),
use_action_history=True,
use_think_history=args.Choice([True, False], p=[0.7, 0.3]),
use_diff=args.Choice([True, False], p=[0.3, 0.7]),
html_type="pruned_html",
use_screenshot=False,
use_som=False,
extract_visible_tag=args.Choice([True, False]),
extract_clickable_tag=False,
extract_coords=args.Choice(["center", "box"]),
filter_visible_elements_only=args.Choice([True, False], p=[0.3, 0.7]),
),
action=dp.ActionFlags(
action_set=bgym.HighLevelActionSetArgs(
subsets=args.Choice([["bid"], ["bid", "coord"]]),
multiaction=args.Choice([True, False], p=[0.7, 0.3]),
),
long_description=False,
individual_examples=False,
),
# drop_ax_tree_first=True, # this flag is no longer active, according to browsergym doc
use_plan=args.Choice([True, False]),
use_criticise=args.Choice([True, False], p=[0.7, 0.3]),
use_thinking=args.Choice([True, False], p=[0.7, 0.3]),
use_memory=args.Choice([True, False], p=[0.7, 0.3]),
use_concrete_example=True,
use_abstract_example=True,
use_hints=args.Choice([True, False], p=[0.7, 0.3]),
be_cautious=args.Choice([True, False]),
enable_chat=False,
max_prompt_tokens=40_000,
extra_instructions=None,
)
RANDOM_SEARCH_AGENT = GenericAgentArgs(
chat_model_args=CHAT_MODEL_ARGS_DICT["openai/gpt-4o-2024-05-13"],
flags=DEFAULT_RS_FLAGS,
)