Your question rises to the top and the answer streams in under it as Markdown, the way Siri answers. Photos run full width, cards you design sit inside the reply, and a status line tells people what the assistant is doing.
Hand it your messages as usual, then switch the style. Stream a reply by appending one message and rewriting its text as tokens arrive.
https://github.com/unionst/swift-chat.git
Chat(thread.messages, typingUsers: thread.thinking ? [assistant] : []) { message in
Message(message.text, role: message.role, timestamp: message.sentAt)
.messageMedia(message.media)
}
.chatStyle(.assistant)
.chatTypingStatus(thread.status)
.chatInputCapabilities([.camera, .photoLibrary, .files])
.onChatSend { text, media in
await thread.send(text, media)
}