Skip to content

Commit

Permalink
added extra checks around picking plan
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Aug 26, 2024
1 parent 9fe4c78 commit 3e3d6df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vision_agent/agent/vision_agent_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ def pick_plan(
pass
count += 1

if best_plan is None:
if (
best_plan is None
or "best_plan" not in best_plan
or ("best_plan" in best_plan and best_plan["best_plan"] not in plans)
):
best_plan = {"best_plan": list(plans.keys())[0]}

if verbosity >= 1:
Expand Down Expand Up @@ -820,6 +824,7 @@ def chat_with_workflow(
verbosity=self.verbosity,
media=media_list,
)
__import__("ipdb").set_trace()
success = cast(bool, results["success"])
code = cast(str, results["code"])
test = cast(str, results["test"])
Expand Down

0 comments on commit 3e3d6df

Please sign in to comment.