Geminix.V1beta.File (geminix v0.2.0)
A file uploaded to the API. Next ID: 15
Fields:
:create_time(DateTime.t/0) - Output only. The timestamp of when theFilewas created.:display_name(binary/0) - Optional. The human-readable display name for theFile. The display name must be no more than 512 characters in length, including spaces. Example: "Welcome Image":download_uri(binary/0) - Output only. The download uri of theFile.:error(Geminix.V1beta.Status.t/0) - Output only. Error status if File processing failed.:expiration_time(DateTime.t/0) - Output only. The timestamp of when theFilewill be deleted. Only set if theFileis scheduled to expire.:mime_type(binary/0) - Output only. MIME type of the file.:name(binary/0) - Immutable. Identifier. TheFileresource name. The ID (name excluding the "files/" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example:files/123-456:sha256_hash(binary/0) - Output only. SHA-256 hash of the uploaded bytes.:size_bytes(binary/0) - Output only. Size of the file in bytes.:source(binary/0) - Source of the File.:state(binary/0) - Output only. Processing state of the File.:update_time(DateTime.t/0) - Output only. The timestamp of when theFilewas last updated.:uri(binary/0) - Output only. The uri of theFile.:video_metadata(Geminix.V1beta.VideoFileMetadata.t/0) - Output only. Metadata for a video.
Summary
Functions
Create a Geminix.V1beta.File.t/0 from a map returned
by the Gemini API.
Extract the MIME type from the file path by inspecting the file extension or the file contents.
Upload a file from a local path.
Types
@type t() :: %Geminix.V1beta.File{ __meta__: term(), create_time: DateTime.t(), display_name: binary(), download_uri: binary(), error: Geminix.V1beta.Status.t(), expiration_time: DateTime.t(), mime_type: binary(), name: binary(), sha256_hash: binary(), size_bytes: binary(), source: binary(), state: binary(), update_time: DateTime.t(), uri: binary(), video_metadata: Geminix.V1beta.VideoFileMetadata.t() }
Functions
@spec from_map(t(), map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Create a Geminix.V1beta.File.t/0 from a map returned
by the Gemini API.
Sometimes, this function should not be applied to the full response body, but instead it should be applied to the correct part of the map in the response body. This depends on the concrete API call.
Extract the MIME type from the file path by inspecting the file extension or the file contents.
@spec upload( Path.t(), keyword() ) :: {:ok, t()} | {:error, {:invalid_data, Ecto.Changeset.t()}} | {:error, {:bad_response, Req.Response.t()}}
Upload a file from a local path.