diff --git a/python/samples/agentchat_fastapi/app_agent.py b/python/samples/agentchat_fastapi/app_agent.py index 9f114a651655..4a0afd6ad71f 100644 --- a/python/samples/agentchat_fastapi/app_agent.py +++ b/python/samples/agentchat_fastapi/app_agent.py @@ -88,8 +88,8 @@ async def chat(request: TextMessage) -> TextMessage: # Save chat history to file. history = await get_history() - history.append(request.model_dump()) - history.append(response.chat_message.model_dump()) + history.append(request.dump()) + history.append(response.chat_message.dump()) async with aiofiles.open(history_path, "w") as file: await file.write(json.dumps(history)) diff --git a/python/samples/agentchat_fastapi/app_team.py b/python/samples/agentchat_fastapi/app_team.py index a67ce3c4f19c..4f32badff6d2 100644 --- a/python/samples/agentchat_fastapi/app_team.py +++ b/python/samples/agentchat_fastapi/app_team.py @@ -121,10 +121,10 @@ async def _user_input(prompt: str, cancellation_token: CancellationToken | None) async for message in stream: if isinstance(message, TaskResult): continue - await websocket.send_json(message.model_dump()) + await websocket.send_json(message.dump()) if not isinstance(message, UserInputRequestedEvent): # Don't save user input events to history. - history.append(message.model_dump()) + history.append(message.dump()) # Save team state to file. async with aiofiles.open(state_path, "w") as file: