Skip to content

Commit 401e983

Browse files
committed
add imageURL
1 parent dd4ae93 commit 401e983

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

firebaseai/ChatExample/Models/ChatMessage.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ public struct ChatMessage: Message {
2626
public var groundingMetadata: GroundingMetadata?
2727
public var attachments: [MultimodalAttachment] = []
2828
public var image: UIImage?
29+
// required by the Message protocol, but not used in this app
30+
public var imageURL: String?
2931

30-
public init(content: String? = nil, participant: Participant,
32+
public init(content: String? = nil, imageURL: String? = nil, participant: Participant,
3133
error: (any Error)? = nil, pending: Bool = false,
3234
attachments: [MultimodalAttachment] = [], image: UIImage? = nil) {
3335
self.content = content
36+
self.imageURL = imageURL
3437
self.participant = participant
3538
self.error = error
3639
self.pending = pending
@@ -39,8 +42,9 @@ public struct ChatMessage: Message {
3942
}
4043

4144
// Protocol-required initializer
42-
public init(content: String?, participant: Participant) {
45+
public init(content: String?, imageURL: String? = nil, participant: Participant) {
4346
self.content = content
47+
self.imageURL = imageURL
4448
self.participant = participant
4549
error = nil
4650
}

0 commit comments

Comments
 (0)