Skip to content

Commit d2c1b43

Browse files
committed
Fix Chat_todo example
1 parent d78e501 commit d2c1b43

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

agent_todo/src/agents/agent_todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def message(self, message: MessageEvent) -> list[Message]:
120120
result = await agent.child_execute(
121121
workflow=TodoExecute,
122122
workflow_id=tool_call.id,
123-
input=args,
123+
workflow_input=args,
124124
)
125125
self.messages.append(
126126
Message(

agent_todo/src/workflows/todo_execute.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,28 @@ class TodoExecuteResponse(BaseModel):
2323
@workflow.defn()
2424
class TodoExecute:
2525
@workflow.run
26-
async def run(self, params: TodoExecuteParams) -> TodoExecuteResponse:
26+
async def run(self, workflow_input: TodoExecuteParams) -> TodoExecuteResponse:
2727
log.info("TodoExecuteWorkflow started")
2828
random = await workflow.step(
29-
get_random,
30-
function_input=RandomParams(todo_title=params.todo_title),
29+
function=get_random,
30+
function_input=RandomParams(todo_title=workflow_input.todo_title),
3131
start_to_close_timeout=timedelta(seconds=120),
3232
)
3333

3434
await workflow.sleep(2)
3535

3636
result = await workflow.step(
37-
get_result,
38-
function_input=ResultParams(todo_title=params.todo_title, todo_id=params.todo_id),
37+
function=get_result,
38+
function_input=ResultParams(
39+
todo_title=workflow_input.todo_title,
40+
todo_id=workflow_input.todo_id,
41+
),
3942
start_to_close_timeout=timedelta(seconds=120),
4043
)
4144

4245
todo_details = TodoExecuteResponse(
43-
todo_id=params.todo_id,
44-
todo_title=params.todo_title,
46+
todo_id=workflow_input.todo_id,
47+
todo_title=workflow_input.todo_title,
4548
details=random,
4649
status=result.status,
4750
)

0 commit comments

Comments
 (0)