Skip to content

Commit 3a3d602

Browse files
committed
task_info
1 parent 5fbbe57 commit 3a3d602

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src/agentlab/analyze/error_analysis/summarizer.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ def make_prompt(self, exp_results: ExpResult, summaries: list[str]): ...
9191
def __call__(self, exp_results: ExpResult) -> EpisodeAnalysis:
9292
"""Run Change Summarizer for every step in the episode or extract a pre-computed one."""
9393

94-
# if exp_results.steps_info[-1].reward == 1:
95-
# return {"analysis": "Success", "summaries": {}}
94+
if exp_results.steps_info[-1].reward == 1:
95+
return {"analysis": "Success", "summaries": {}}
9696

9797
with set_tracker("summary") as summaries_tracker:
9898
summaries = self.make_change_summaries(exp_results)
@@ -119,9 +119,7 @@ def make_change_summaries(self, exp_result: ExpResult) -> list[str]:
119119
return summaries
120120

121121
def parse(self, raw_output: str) -> dict:
122-
parsed_result = parse_html_tags(
123-
raw_output, keys=["explanation", "success", "errorCategory"]
124-
)[0]
122+
parsed_result = parse_html_tags(raw_output, keys=["explanation", "errorCategory"])[0]
125123
return parsed_result
126124

127125

@@ -153,8 +151,12 @@ def format_summary(summary):
153151
for action, action_error in zip(actions, action_errors)
154152
]
155153
)
154+
155+
extra_info = exp_results.steps_info[-1].task_info
156+
156157
return ERROR_CLASSIFICATION_PROMPT.format(
157158
goal=goal,
158159
historical_summaries=txt_summaries,
159160
action_history=txt_actions,
161+
extra_info=extra_info,
160162
)

src/agentlab/analyze/error_analysis/summarizer_prompts.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,30 +132,24 @@
132132
- The current HTML or AX Tree observation
133133
- The user goal
134134
135-
2. In case you think the task was unsuccessful, decide the category, or a combination thereof, under which the reason for failure lies.
136-
If the task is successful, you can keep the error category as blank.
135+
2. Decide the error category, or a combination thereof, under which the reason for failure lies.
137136
138137
3. Provide a brief explanation justifying your classification, referencing specific steps if helpful.
139138
140-
Output format example for an unsuccessful interaction:
139+
Output format example for an interaction:
141140
142141
<explanation>The agent opened the wrong GitLab page and never recovered...</explanation>
143-
<success>False</success>
144142
<errorCategory>["Navigation & Planning"]</errorCategory>
145143
146-
Output format example for a successful interaction:
147-
148-
<explanation>The agent opened the correct GitLab page and ...</explanation>
149-
<success>True</success>
150-
<errorCategory>[]</errorCategory>
151-
152144
Please follow this structure at every step. Keep your responses concise and clear.
153145
154-
Below are the details for the interaction.
146+
Below are the details for the interaction. Extra information yields additional information from the environment. It might not always be present or relevant.
155147
156148
Overall goal: {goal}
157149
158150
Historical change summaries: {historical_summaries}
159151
160152
Action history: {action_history}
153+
154+
Extra information: {extra_info}
161155
"""

0 commit comments

Comments
 (0)