Part

public interface Part

Known direct subclasses
FileDataPart

Represents file data stored in Cloud Storage for Firebase, referenced by URI.

FunctionCallPart

Represents function call name and params received from requests.

FunctionResponsePart

Represents function call output to be returned to the model when it requests a function call.

ImagePart

Represents image data sent to and received from requests.

InlineDataPart

Represents binary data with an associated MIME type sent to and received from requests.

TextPart

Represents text or string based data sent to and received from requests.


Interface representing data sent to and received from requests.

Summary

Extension functions

default final FileDataPart

Returns the part as a FileDataPart if it represents a file, and null otherwise

default final Bitmap

Returns the part as a Bitmap if it represents an image, and null otherwise

default final InlineDataPart

Returns the part as a InlineDataPart if it represents inline data, and null otherwise

default final String

Returns the part as a String if it represents text, and null otherwise

Extension functions

PartKt.asFileDataOrNull

default final FileDataPart PartKt.asFileDataOrNull(@NonNull Part receiver)

Returns the part as a FileDataPart if it represents a file, and null otherwise

PartKt.asImageOrNull

default final Bitmap PartKt.asImageOrNull(@NonNull Part receiver)

Returns the part as a Bitmap if it represents an image, and null otherwise

PartKt.asInlineDataPartOrNull

default final InlineDataPart PartKt.asInlineDataPartOrNull(@NonNull Part receiver)

Returns the part as a InlineDataPart if it represents inline data, and null otherwise

PartKt.asTextOrNull

default final String PartKt.asTextOrNull(@NonNull Part receiver)

Returns the part as a String if it represents text, and null otherwise