Skip to content

Commit

Permalink
Fix formatting bug when listing
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Jul 30, 2023
1 parent ba4388d commit 39263ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion agentagenda/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def create_task(goal, plan=None, steps=None, model="gpt-3.5-turbo-0613"):

steps = response["arguments"]["steps"]

step_items = []

for step in steps:
step_items.append({"content": step, "completed": False})

steps = step_items

# if steps is a dict, json stringify it
if isinstance(steps, dict) or isinstance(steps, list):
steps = json.dumps(steps)
Expand Down Expand Up @@ -460,7 +467,7 @@ def finish_step(task, step):
metadata = task["metadata"]
steps = json.loads(metadata["steps"])
for s in steps:
if s["content"] == step:
if s["content"].includes(step):
s["completed"] = True
metadata["steps"] = json.dumps(steps)
log(
Expand Down Expand Up @@ -543,6 +550,7 @@ def get_task_as_formatted_string(
if include_steps:
# For the steps, since it's a list, we need to format each step separately
steps = json.loads(task["metadata"]["steps"])

formatted_steps = ", ".join(
[
"{}: {}".format(
Expand Down

0 comments on commit 39263ca

Please sign in to comment.