Part

public interface Part

Known direct subclasses
BlobPart

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

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.

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 BlobPart

Returns the part as a BlobPart if it represents a blob, and null otherwise

default final Bitmap

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

default final String

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

Extension functions

PartKt.asBlobPartOrNull

default final BlobPart PartKt.asBlobPartOrNull(@NonNull Part receiver)

Returns the part as a BlobPart if it represents a blob, 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.asTextOrNull

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

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