Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ async def post_request(
event_type = line[6:].decode("utf-8").strip()
if line.startswith(b"data:") and event_type == "activity":
activity_data = line[5:].decode("utf-8").strip()
activity = Activity.model_validate_json(activity_data)

if activity.type == ActivityTypes.message:
self._current_conversation_id = activity.conversation.id

yield activity
try:
activity = Activity.model_validate_json(activity_data)
if activity.type == ActivityTypes.message:
self._current_conversation_id = activity.conversation.id
yield activity
except Exception as e:
print(f"Error parsing activity: {e} - {activity_data}")

async def start_conversation(
self, emit_start_conversation_event: bool = True
Expand Down