Skip to content

Commit 5e88a61

Browse files
committed
fix flow thread kwarg
1 parent ba2338c commit 5e88a61

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

examples/memory_between_flows.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import controlflow as cf
2+
3+
thread_id = "test-thread"
4+
5+
6+
@cf.flow(thread=thread_id)
7+
def flow_1():
8+
task = cf.Task("get the user's name", result_type=str, user_access=True)
9+
return task
10+
11+
12+
@cf.flow(thread=thread_id)
13+
def flow_2():
14+
task = cf.Task("write the user's name backwards, if you don't know it, say so")
15+
return task
16+
17+
18+
if __name__ == "__main__":
19+
flow_1()
20+
flow_2()

src/controlflow/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def wrapper(
9292
flow_kwargs = kwargs | (flow_kwargs or {})
9393

9494
if thread is not None:
95-
flow_kwargs.setdefault("thread", thread)
95+
flow_kwargs.setdefault("thread_id", thread)
9696
if tools is not None:
9797
flow_kwargs.setdefault("tools", tools)
9898
if agents is not None:

0 commit comments

Comments
 (0)