Package com.google.genai.types
Class FileData
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.FileData
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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileData.Builderbuilder()Instantiates a builder for FileData.Optional.fileUri()Required.static FileDataDeserializes a JSON string to a FileData object.mimeType()Required.abstract FileData.BuilderCreates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
FileData
public FileData()
-
-
Method Details
-
displayName
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. -
fileUri
Required. The URI of the file in Google Cloud Storage. -
mimeType
Required. The IANA standard MIME type of the source data. -
builder
Instantiates a builder for FileData. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a FileData object.
-