Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/samples/agentchat_fastapi/app_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions python/samples/agentchat_fastapi/app_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down