@@ -26,7 +26,7 @@ public struct ModelContent: Equatable, Sendable {
26
26
case text( String )
27
27
28
28
/// 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 )
30
30
31
31
/// File data stored in Cloud Storage for Firebase, referenced by URI.
32
32
///
@@ -53,12 +53,12 @@ public struct ModelContent: Equatable, Sendable {
53
53
54
54
/// Convenience function for populating a Part with JPEG data.
55
55
public static func jpeg( _ data: Data ) -> Self {
56
- return . data ( mimetype: " image/jpeg " , data)
56
+ return . inlineData ( mimetype: " image/jpeg " , data)
57
57
}
58
58
59
59
/// Convenience function for populating a Part with PNG data.
60
60
public static func png( _ data: Data ) -> Self {
61
- return . data ( mimetype: " image/png " , data)
61
+ return . inlineData ( mimetype: " image/png " , data)
62
62
}
63
63
64
64
/// Returns the text contents of this ``Part``, if it contains text.
@@ -144,7 +144,7 @@ extension ModelContent.Part: Codable {
144
144
switch self {
145
145
case let . text( a0) :
146
146
try container. encode ( a0, forKey: . text)
147
- case let . data ( mimetype, bytes) :
147
+ case let . inlineData ( mimetype, bytes) :
148
148
var inlineDataContainer = container. nestedContainer (
149
149
keyedBy: InlineDataKeys . self,
150
150
forKey: . inlineData
@@ -176,7 +176,7 @@ extension ModelContent.Part: Codable {
176
176
)
177
177
let mimetype = try dataContainer. decode ( String . self, forKey: . mimeType)
178
178
let bytes = try dataContainer. decode ( Data . self, forKey: . bytes)
179
- self = . data ( mimetype: mimetype, bytes)
179
+ self = . inlineData ( mimetype: mimetype, bytes)
180
180
} else if values. contains ( . functionCall) {
181
181
self = try . functionCall( values. decode ( FunctionCall . self, forKey: . functionCall) )
182
182
} else if values. contains ( . functionResponse) {
0 commit comments