Skip to content

Commit e458363

Browse files
committed
Fix change to run fns
1 parent b835fd6 commit e458363

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/controlflow/tasks/task.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,13 +694,15 @@ def run(
694694
max_turns: int = None,
695695
**task_kwargs,
696696
):
697-
return controlflow.run(
698-
objective,
697+
task = Task(
698+
objective=objective,
699699
*task_args,
700+
**task_kwargs,
701+
)
702+
return task.run(
700703
turn_strategy=turn_strategy,
701704
max_calls_per_turn=max_calls_per_turn,
702705
max_turns=max_turns,
703-
**task_kwargs,
704706
)
705707

706708

@@ -712,11 +714,13 @@ async def run_async(
712714
max_turns: int = None,
713715
**task_kwargs,
714716
):
715-
return await controlflow.run_async(
716-
objective,
717+
task = Task(
718+
objective=objective,
717719
*task_args,
720+
**task_kwargs,
721+
)
722+
return await task.run_async(
718723
turn_strategy=turn_strategy,
719724
max_calls_per_turn=max_calls_per_turn,
720725
max_turns=max_turns,
721-
**task_kwargs,
722726
)

0 commit comments

Comments
 (0)