Skip to content

Commit

Permalink
Bypass json5 load subtasks in plan_exec.py unless its a string
Browse files Browse the repository at this point in the history
  • Loading branch information
LostQuant committed May 1, 2024
1 parent 3619c25 commit 8f39e6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion XAgent/workflow/plan_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ def initial_plan_generation(self, agent_dispatcher):
functions=[split_functions],
)

subtasks = json5.loads(new_message["function_call"]["arguments"])
subtasks = new_message["function_call"]["arguments"]

# To preserve the original flow in case `subtasks` is a string or bytes
if isinstance(subtasks, (str, bytes)):
subtasks = json5.loads(subtasks)

for subtask_item in subtasks["subtasks"]:
subplan = plan_function_output_parser(subtask_item)
Expand Down

0 comments on commit 8f39e6a

Please sign in to comment.