Part

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

BlobPart?

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

Bitmap?

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

String?

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

Extension functions

asBlobPartOrNull

fun Part.asBlobPartOrNull(): BlobPart?

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

asImageOrNull

fun Part.asImageOrNull(): Bitmap?

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

asTextOrNull

fun Part.asTextOrNull(): String?

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