FileData

@Serializable
data class FileData(val displayName: String? = null, val fileUri: String? = null, val mimeType: String? = null)

URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage.

Constructors

Link copied to clipboard
constructor(displayName: String? = null, fileUri: String? = null, mimeType: String? = null)

Properties

Link copied to clipboard
val displayName: String? = null

Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in PromptMessage for prompt management. It is used in the Gemini calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API.

Link copied to clipboard
val fileUri: String? = null

Required. The URI of the file in Google Cloud Storage.

Link copied to clipboard
val mimeType: String? = null

Required. The IANA standard MIME type of the source data.