From 772045666fbc4bd512bb8a05fdf9b60c58b63957 Mon Sep 17 00:00:00 2001 From: shankar-landing-ai Date: Tue, 27 Aug 2024 16:31:53 -0700 Subject: [PATCH] adding the multplan log only when user invokes multi plan mode --- vision_agent/agent/vision_agent_coder.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vision_agent/agent/vision_agent_coder.py b/vision_agent/agent/vision_agent_coder.py index 6bba2905..d31ed70d 100644 --- a/vision_agent/agent/vision_agent_coder.py +++ b/vision_agent/agent/vision_agent_coder.py @@ -756,13 +756,17 @@ 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} for e in plans[p]["instructions"]] - _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} for e in plans[p]["instructions"] + ] + _LOGGER.info( + f"\n{tabulate(tabular_data=p_fixed, headers='keys', tablefmt='mixed_grid', maxcolwidths=_MAX_TABULATE_COL_WIDTH)}" + ) + tool_infos = retrieve_tools( plans, self.tool_recommender,