Content.Builder
class Content.Builder
Builder class to facilitate constructing complex Content objects.
Summary
Public constructors |
|---|
Builder() |
Public functions |
|
|---|---|
Content |
build() |
Content.Builder |
Adds a new |
Content.Builder |
|
Content.Builder |
inlineData(bytes: ByteArray, mimeType: String)Adds a new |
Content.Builder |
|
Content.Builder |
Public properties |
|
|---|---|
MutableList<Part> |
|
String? |
The producer of the content. |
Public constructors
Public functions
fileData
fun fileData(uri: String, mimeType: String): Content.Builder
Adds a new FileDataPart with the provided uri and mimeType to parts.
inlineData
fun inlineData(bytes: ByteArray, mimeType: String): Content.Builder
Adds a new InlineDataPart with the provided bytes, which should be interpreted by the model based on the mimeType, to parts.
Public properties
parts
var parts: MutableList<Part>
The mutable list of Parts comprising the Content.
Prefer using the provided helper methods over modifying this list directly.