Skip to content

Commit

Permalink
multi plan
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Jul 23, 2024
1 parent 4a45567 commit 3fa91ee
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions vision_agent/agent/vision_agent_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,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 VisionAgentCoder and return intermediate information regarding the
Expand All @@ -595,6 +596,9 @@ def chat_with_workflow(
[{"role": "user", "content": "describe your task here..."}]
or if it contains media files, it should be in the format of:
[{"role": "user", "content": "describe your task here...", "media": ["image1.jpg", "image2.jpg"]}]
test_multi_plan (bool): If True, it will test tools for multiple plans and
pick the best one based off of the tool results. If False, it will go
with the first plan.
display_visualization (bool): If True, it opens a new window locally to
show the image(s) created by visualization code (if there is any).
Expand Down Expand Up @@ -666,14 +670,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 3fa91ee

Please sign in to comment.