Skip to content

Commit 50036eb

Browse files
authored
[Vertex AI] Add documentation for InlineDataPart (#14416)
1 parent 49831bf commit 50036eb

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

FirebaseVertexAI/Sources/Types/Public/Part.swift

+27-2
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,41 @@ public struct TextPart: Part {
3131
}
3232
}
3333

34-
/// Data with a specified media type.
34+
/// A data part that is provided inline in requests.
3535
///
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.
3745
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
3846
public struct InlineDataPart: Part {
3947
let inlineData: InlineData
4048

49+
/// The data provided in the inline data part.
4150
public var data: Data { inlineData.data }
51+
52+
/// The IANA standard MIME type of the data.
4253
public var mimeType: String { inlineData.mimeType }
4354

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.
4469
public init(data: Data, mimeType: String) {
4570
self.init(InlineData(data: data, mimeType: mimeType))
4671
}

0 commit comments

Comments
 (0)