@@ -93,7 +93,7 @@ public protocol Message: Identifiable, Hashable {
9393 var content: String ? { get set }
9494 var imageURL: String ? { get }
9595 var participant: Participant { get }
96- var error: Error ? { get }
96+ var error: ( any Error ) ? { get }
9797
9898 init (content : String ? , imageURL : String ? , participant : Participant)
9999}
@@ -108,20 +108,35 @@ ConversationKit provides a default implementation of this protocol, `DefaultMess
108108
109109### ConversationView
110110
111- The main chat interface with two initializers:
112-
113- 1 . ** Built-in rendering** (default):
114- ``` swift
115- ConversationView (messages : $messages)
116- ```
117-
118- 2 . ** Custom rendering** :
119- ``` swift
120- ConversationView (messages : $messages) { message in
121- // Your custom message view
122- CustomMessageView (message : message)
123- }
124- ```
111+ The main chat interface. It can be initialized in a few ways:
112+
113+ 1 . ** With ` DefaultMessage ` and attachments** :
114+ ``` swift
115+ ConversationView (
116+ messages : $messages,
117+ attachments : $attachments,
118+ userPrompt : $userPrompt
119+ )
120+ ```
121+ 2 . ** With a custom message type and attachments** :
122+ ```swift
123+ ConversationView< MyCustomMessage> (
124+ messages : $messages,
125+ attachments : $attachments,
126+ userPrompt : $userPrompt
127+ )
128+ ```
129+ 3 . ** With custom message rendering** :
130+ ```swift
131+ ConversationView (
132+ messages : $messages,
133+ attachments : $attachments,
134+ userPrompt : $userPrompt
135+ ) { message in
136+ // Your custom message view
137+ CustomMessageView (message : message)
138+ }
139+ ```
125140
126141## Advanced Usage
127142
@@ -211,6 +226,8 @@ ConversationView(messages: $messages)
211226
212227### Disable Attachments
213228
229+ You can disable the attachments button by applying the ` .disableAttachments() ` modifier to the ` ConversationView ` . This will hide the button in the ` MessageComposerView ` .
230+
214231``` swift
215232ConversationView (messages : $messages)
216233 .disableAttachments ()
0 commit comments