Skip to content

Commit

Permalink
added flag for testing multiple plans (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird authored Jul 19, 2024
1 parent 3d5e3af commit a36f0b9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ def __call__(
def chat_with_workflow(
self,
chat: List[Message],
test_multi_plan: bool = True,
display_visualization: bool = False,
) -> Dict[str, Any]:
"""Chat with Vision Agent and return intermediate information regarding the task.
Expand Down Expand Up @@ -691,7 +692,7 @@ def chat_with_workflow(
self.planner,
)

if self.verbosity >= 1:
if self.verbosity >= 1 and test_multi_plan:
for p in plans:
_LOGGER.info(
f"\n{tabulate(tabular_data=plans[p], headers='keys', tablefmt='mixed_grid', maxcolwidths=_MAX_TABULATE_COL_WIDTH)}"
Expand All @@ -703,14 +704,19 @@ def chat_with_workflow(
self.log_progress,
self.verbosity,
)
best_plan, tool_output_str = pick_plan(
int_chat,
plans,
tool_infos["all"],
self.coder,
code_interpreter,
verbosity=self.verbosity,
)

if test_multi_plan:
best_plan, tool_output_str = pick_plan(
int_chat,
plans,
tool_infos["all"],
self.coder,
code_interpreter,
verbosity=self.verbosity,
)
else:
best_plan = list(plans.keys())[0]
tool_output_str = ""

if best_plan in plans and best_plan in tool_infos:
plan_i = plans[best_plan]
Expand Down

0 comments on commit a36f0b9

Please sign in to comment.