@@ -31,16 +31,41 @@ public struct TextPart: Part {
31
31
}
32
32
}
33
33
34
- /// Data with a specified media type .
34
+ /// A data part that is provided inline in requests .
35
35
///
36
- /// > Note: Not all media types may be supported by the AI model.
36
+ /// Data provided as an inline data part is encoded as base64 and included directly (inline) in the
37
+ /// request. For large files, see ``FileDataPart`` which references content by URI instead of
38
+ /// including the data in the request.
39
+ ///
40
+ /// > Important: Only small files can be sent as inline data because of limits on total request
41
+ /// sizes;
42
+ /// see [input files and requirements
43
+ /// ](https://firebase.google.com/docs/vertex-ai/input-file-requirements#provide-file-as-inline-data)
44
+ /// for more details and size limits.
37
45
@available ( iOS 15 . 0 , macOS 12 . 0 , macCatalyst 15 . 0 , tvOS 15 . 0 , watchOS 8 . 0 , * )
38
46
public struct InlineDataPart : Part {
39
47
let inlineData : InlineData
40
48
49
+ /// The data provided in the inline data part.
41
50
public var data : Data { inlineData. data }
51
+
52
+ /// The IANA standard MIME type of the data.
42
53
public var mimeType : String { inlineData. mimeType }
43
54
55
+ /// Creates an inline data part from data and a MIME type.
56
+ ///
57
+ /// > Important: Supported input types depend on the model on the model being used; see [input
58
+ /// files and requirements](https://firebase.google.com/docs/vertex-ai/input-file-requirements)
59
+ /// for more details.
60
+ ///
61
+ /// - Parameters:
62
+ /// - data: The data representation of an image, video, audio or document; see [input files and
63
+ /// requirements](https://firebase.google.com/docs/vertex-ai/input-file-requirements) for
64
+ /// supported media types.
65
+ /// - mimeType: The IANA standard MIME type of the data, for example, `"image/jpeg"` or
66
+ /// `"video/mp4"`; see [input files and
67
+ /// requirements](https://firebase.google.com/docs/vertex-ai/input-file-requirements) for
68
+ /// supported values.
44
69
public init ( data: Data , mimeType: String ) {
45
70
self . init ( InlineData ( data: data, mimeType: mimeType) )
46
71
}
0 commit comments