Skip to content

Commit 12016cb

Browse files
committed
update
1 parent ace3e41 commit 12016cb

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/agentlab/agents/vl_agent/vl_prompt/ui_prompt.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,45 @@ def __init__(
126126
def get_message_content(self) -> list[dict]:
127127
return [{"type": "text", "text": self.text}]
128128

129+
class PreliminaryAnswerPromptPart(VLPromptPart):
130+
def __init__(
131+
self, action_set_description: str, use_abstract_example: bool, use_concrete_example: bool
132+
):
133+
text = f"""\
134+
# The action space
135+
Here are all the actions you can take to interact with the browser. \
136+
They are Python functions based on the Playwright library.
137+
{action_set_description}
138+
# The format of the answer
139+
Think about the action to take, and describe the location to take the action. \
140+
Your answer should include one thought and one location.
141+
"""
142+
if use_abstract_example:
143+
text += """\
144+
# An abstract example of the answer
145+
<thought>
146+
The thought about the action.
147+
</thought>
148+
<location>
149+
The description of the location.
150+
</location>
151+
"""
152+
if use_concrete_example:
153+
text += """\
154+
# A concrete example of the answer
155+
<thought>
156+
The goal is to click on the numbers in ascending order. \
157+
The smallest number visible on the screen is '1'. \
158+
I will use the 'mouse_click' action to directly click on the number '1'.
159+
</thought>
160+
<location>
161+
The number '1' in the top-left quadrant of the white area.
162+
</location>
163+
"""
164+
self.text = text
165+
166+
def get_message_content(self) -> list[dict]:
167+
return [{"type": "text", "text": self.text}]
129168

130169
class AnswerPromptPart(VLPromptPart):
131170
def __init__(

0 commit comments

Comments
 (0)