@@ -26,7 +26,7 @@ public struct ModelContent: Equatable, Sendable {
2626 case text( String )
2727
2828 /// Data with a specified media type. Not all media types may be supported by the AI model.
29- case data ( mimetype: String , Data )
29+ case inlineData ( mimetype: String , Data )
3030
3131 /// File data stored in Cloud Storage for Firebase, referenced by URI.
3232 ///
@@ -53,12 +53,12 @@ public struct ModelContent: Equatable, Sendable {
5353
5454 /// Convenience function for populating a Part with JPEG data.
5555 public static func jpeg( _ data: Data ) -> Self {
56- return . data ( mimetype: " image/jpeg " , data)
56+ return . inlineData ( mimetype: " image/jpeg " , data)
5757 }
5858
5959 /// Convenience function for populating a Part with PNG data.
6060 public static func png( _ data: Data ) -> Self {
61- return . data ( mimetype: " image/png " , data)
61+ return . inlineData ( mimetype: " image/png " , data)
6262 }
6363
6464 /// Returns the text contents of this ``Part``, if it contains text.
@@ -144,7 +144,7 @@ extension ModelContent.Part: Codable {
144144 switch self {
145145 case let . text( a0) :
146146 try container. encode ( a0, forKey: . text)
147- case let . data ( mimetype, bytes) :
147+ case let . inlineData ( mimetype, bytes) :
148148 var inlineDataContainer = container. nestedContainer (
149149 keyedBy: InlineDataKeys . self,
150150 forKey: . inlineData
@@ -176,7 +176,7 @@ extension ModelContent.Part: Codable {
176176 )
177177 let mimetype = try dataContainer. decode ( String . self, forKey: . mimeType)
178178 let bytes = try dataContainer. decode ( Data . self, forKey: . bytes)
179- self = . data ( mimetype: mimetype, bytes)
179+ self = . inlineData ( mimetype: mimetype, bytes)
180180 } else if values. contains ( . functionCall) {
181181 self = try . functionCall( values. decode ( FunctionCall . self, forKey: . functionCall) )
182182 } else if values. contains ( . functionResponse) {
0 commit comments