ImagePart
class ImagePart: TaskPartImage part representing the image content block of a multi-modal block.
-
Initializes a new
MPPImagePartusing in-memory image buffer data.Declaration
Swift
convenience init(data: Data)Parameters
dataThe raw image data bytes.
Return Value
An instance of
MPPImagePartconfigured with in-memory data. -
Initializes a new
MPPImagePartusing a path or resource handle.Declaration
Swift
convenience init(filePath: String)Parameters
filePathThe path or resource handle for the image.
Return Value
An instance of
MPPImagePartconfigured with the file path. -
Initializes a new
MPPImagePartwith both a resource handle and transient in-memory image data.Declaration
Swift
init(filePath: String?, data: Data?)Parameters
filePathThe optional path or resource identifier handle to persist in storage.
dataThe optional raw image data bytes to use for in-memory embedding.
Return Value
An instance of
MPPImagePart. -
The raw in-memory image buffer, if initialized with data. Nil if initialized from a file path alone or deserialized from persistent storage.
Declaration
Swift
var data: Data? { get } -
The filesystem path or resource identifier handle (e.g., asset URI) for the image. May be provided alongside in-memory
datato persist a lightweight handle while embedding from memory.Declaration
Swift
var filePath: String? { get }