Skip to content

Commit

Permalink
don't print multiple plans if no multi-plan
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Aug 21, 2024
1 parent 62d4e8e commit 2c482f9
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions vision_agent/agent/vision_agent_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,20 +734,21 @@ def chat_with_workflow(
self.planner,
)

if self.verbosity >= 1:
for p in plans:
# tabulate will fail if the keys are not the same for all elements
p_fixed = [
{
"instructions": (
e["instructions"] if "instructions" in e else ""
)
}
for e in plans[p]
]
_LOGGER.info(
f"\n{tabulate(tabular_data=p_fixed, headers='keys', tablefmt='mixed_grid', maxcolwidths=_MAX_TABULATE_COL_WIDTH)}"
)
if test_multi_plan:
if self.verbosity >= 1:
for p in plans:
# tabulate will fail if the keys are not the same for all elements
p_fixed = [
{
"instructions": (
e["instructions"] if "instructions" in e else ""
)
}
for e in plans[p]
]
_LOGGER.info(
f"\n{tabulate(tabular_data=p_fixed, headers='keys', tablefmt='mixed_grid', maxcolwidths=_MAX_TABULATE_COL_WIDTH)}"
)

tool_infos = retrieve_tools(
plans,
Expand Down

0 comments on commit 2c482f9

Please sign in to comment.