Skip to content

Commit 387ca5d

Browse files
recursixgasse
authored andcommitted
add support for tab visibility in observation flags and update related components
1 parent 7e38465 commit 387ca5d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/agentlab/agents/dynamic_prompting.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010

1111
import bgym
1212
from browsergym.core.action.base import AbstractActionSet
13-
from browsergym.utils.obs import flatten_axtree_to_str, flatten_dom_to_str, overlay_som, prune_html
13+
from browsergym.utils.obs import (
14+
flatten_axtree_to_str,
15+
flatten_dom_to_str,
16+
overlay_som,
17+
prune_html,
18+
)
1419

1520
from agentlab.llm.llm_utils import (
1621
BaseMessage,

tests/agents/test_generic_prompt.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
from agentlab.agents import dynamic_prompting as dp
77
from agentlab.agents.generic_agent.agent_configs import FLAGS_GPT_3_5
8-
from agentlab.agents.generic_agent.generic_agent_prompt import GenericPromptFlags, MainPrompt
8+
from agentlab.agents.generic_agent.generic_agent_prompt import (
9+
GenericPromptFlags,
10+
MainPrompt,
11+
)
912
from agentlab.llm.llm_utils import count_tokens
1013

1114
html_template = """
@@ -32,18 +35,15 @@
3235
}
3336

3437
OBS_HISTORY = [
35-
base_obs
36-
| {
38+
base_obs | {
3739
"pruned_html": html_template.format(1),
3840
"last_action_error": "",
3941
},
40-
base_obs
41-
| {
42+
base_obs | {
4243
"pruned_html": html_template.format(2),
4344
"last_action_error": "Hey, this is an error in the past",
4445
},
45-
base_obs
46-
| {
46+
base_obs | {
4747
"pruned_html": html_template.format(3),
4848
"last_action_error": "Hey, there is an error now",
4949
},

0 commit comments

Comments
 (0)