Part

interfacePart

Known direct subclasses
CodeExecutionResultPart

Represents the code execution result from the model.

ExecutableCodePart

Represents the code that was executed by the model.

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

Public properties

Boolean

Extension functions

FileDataPart?

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

Bitmap?

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

InlineDataPart?

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

String?

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

Public properties

isThought

val isThoughtBoolean

Extension functions

asFileDataOrNull

fun Part.asFileDataOrNull(): FileDataPart?

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

asImageOrNull

fun Part.asImageOrNull(): Bitmap?

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

asInlineDataPartOrNull

fun Part.asInlineDataPartOrNull(): InlineDataPart?

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

asTextOrNull

fun Part.asTextOrNull(): String?

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-09-18 UTC.