Skip to content

Commit

Permalink
Better format for execution outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
humpydonkey committed Jun 4, 2024
1 parent b9fdaa5 commit 87bb602
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vision_agent/utils/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,17 @@ def text(self, include_logs: bool = True) -> str:
"""
prefix = str(self.logs) if include_logs else ""
if self.error:
return prefix + "\n" + self.error.traceback
return next(
return prefix + "\nError:" + self.error.traceback

result_str = [
(
prefix + "\n" + (res.text or "")
for res in self.results
f"Final output:{res.text}"
if res.is_main_result
),
prefix,
)
else f"Intermediate output:{res.text}"
)
for res in self.results
]
return prefix + "\n" + "\n".join(result_str)

@property
def success(self) -> bool:
Expand Down

0 comments on commit 87bb602

Please sign in to comment.