Part

interface Part

Known direct subclasses
FileDataPart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.

FunctionCallPart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.

FunctionResponsePart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.

ImagePart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.

InlineDataPart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.

TextPart

This class is deprecated. The Vertex AI in Firebase SDK (firebase-vertexai) has been replaced with the FirebaseAI SDK (firebase-ai) to accommodate the evolving set of supported features and services.


Interface representing data sent to and received from requests.

Summary

Extension functions

FileDataPart?

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

Bitmap?

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

InlineDataPart?

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

String?

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

Extension functions

asFileDataOrNull

fun Part.asFileDataOrNull(): FileDataPart?

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

asImageOrNull

fun Part.asImageOrNull(): Bitmap?

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

asInlineDataPartOrNull

fun Part.asInlineDataPartOrNull(): InlineDataPart?

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

asTextOrNull

fun Part.asTextOrNull(): String?

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