FilePart

@Serializable
@SerialName(value = "file")
class FilePart(val fileId: String? = null, val fileData: String? = null, val filename: String? = null) : ContentPart

Image passed to the model as a file — either one already uploaded to the Files API, or one inlined as base64.

Exactly one of fileId and fileData must be set.

Constructors

Link copied to clipboard
constructor(fileId: String? = null, fileData: String? = null, filename: String? = null)

Properties

Link copied to clipboard

Base64 data URL carrying the image inline (data:image/jpeg;base64,...). Mutually exclusive with fileId.

Link copied to clipboard

Identifier of a file uploaded to the Files API, of the form file-api-.... Mutually exclusive with fileData.

Link copied to clipboard

Optional name for the inlined image; only valid alongside fileData.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String