Part

public 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 fields

abstract boolean

Extension functions

default finalFileDataPart

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

default finalBitmap

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

default finalInlineDataPart

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

default finalString

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

Public fields

isThought

abstract boolean isThought

Extension functions

PartKt.asFileDataOrNull

default final FileDataPart PartKt.asFileDataOrNull(@NonNullPart receiver)

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

PartKt.asImageOrNull

default final Bitmap PartKt.asImageOrNull(@NonNullPart receiver)

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

PartKt.asInlineDataPartOrNull

default final InlineDataPart PartKt.asInlineDataPartOrNull(@NonNullPart receiver)

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

PartKt.asTextOrNull

default final String PartKt.asTextOrNull(@NonNullPart receiver)

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.