Skip to content

Commit

Permalink
If all commands are returnCode:0 only, modified to execute the next plan
Browse files Browse the repository at this point in the history
  • Loading branch information
saten-private committed May 28, 2023
1 parent c5339af commit 60c6959
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions babyagi.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ def main():
log("\033[33m\033[1m" + "*****EXCUTE COMMAND TASK*****\n\n" +
"\033[0m\033[0m")

is_next_plan = False
while True:

result = execution_command(OBJECTIVE, task['content'], tasks_storage.get_tasks(),
Expand All @@ -684,10 +685,14 @@ def main():
if next_task['type'] == "command":
task = tasks_storage.popleft()
else:
is_next_plan = True
break

log("\033[32m\033[1m" + "*****TASK RESULT*****\n\n" + "\033[0m\033[0m")

if is_next_plan:
continue

# Step 3: Create new tasks and reprioritize task list
new_tasks_list = check_completion_agent(OBJECTIVE, result,
task['content'], tasks_storage.get_tasks(),
Expand Down

0 comments on commit 60c6959

Please sign in to comment.