ImagePart

class ImagePart : Part


Represents image data sent to and received from requests. The image is converted client-side to JPEG encoding at 80% quality before being sent to the server.

Summary

Public companion functions

ImagePart
@PublicPreviewAPI
createWithThinking(
    image: Bitmap,
    displayName: String?,
    isThought: Boolean,
    thoughtSignature: String?
)

Creates an ImagePart with advanced thinking metadata.

Public constructors

ImagePart(image: Bitmap)
ImagePart(image: Bitmap, displayName: String)

Public companion functions

createWithThinking

@PublicPreviewAPI
fun createWithThinking(
    image: Bitmap,
    displayName: String?,
    isThought: Boolean,
    thoughtSignature: String?
): ImagePart

Creates an ImagePart with advanced thinking metadata.

Parameters
image: Bitmap

Bitmap to convert into a Part.

displayName: String?

The name of the file, including the extension.

isThought: Boolean

Indicates whether the response is a thought.

thoughtSignature: String?

The signature associated with the thought, if any.

Public constructors

ImagePart

ImagePart(image: Bitmap)
Parameters
image: Bitmap

Bitmap to convert into a Part

ImagePart

ImagePart(image: Bitmap, displayName: String)
Parameters
image: Bitmap

Bitmap to convert into a Part

Public properties

displayName

val displayNameString?

image

val imageBitmap

isThought

open val isThoughtBoolean

thoughtSignature

val thoughtSignatureString?