Gemini.Types.Part (GeminiEx v0.8.2)
View SourcePart type for content in Gemini API.
Gemini 3 Features
Media Resolution
Control token allocation for media processing with media_resolution:
:low- 280 tokens for images, 70 for video:medium- 560 tokens for images, 70 for video:high- 1120 tokens for images, 280 for video
Thought Signature
Gemini 3 returns thought_signature fields that must be echoed back
in subsequent turns to maintain reasoning context. The SDK handles
this automatically in chat sessions.
Summary
Functions
Create a blob part with raw data and MIME type.
Create a part from a file path.
Parse a part from API payload.
Create an inline data part with base64 encoded data.
Create an inline data part with media resolution for Gemini 3.
Create a text part.
Set media resolution on an existing part.
Set thought signature on an existing part.
Types
@type inline_data() :: Gemini.Types.Blob.t() | nil
Inline data (base64 encoded).
@type t() :: %Gemini.Types.Part{ file_data: Gemini.Types.FileData.t() | nil, function_call: Altar.ADM.FunctionCall.t() | nil, function_response: Gemini.Types.FunctionResponse.t() | nil, inline_data: Gemini.Types.Blob.t() | nil, media_resolution: Gemini.Types.MediaResolution.t() | Gemini.Types.Part.MediaResolution.t() | nil, text: String.t() | nil, thought: boolean() | nil, thought_signature: String.t() | nil }
@type text_content() :: String.t() | nil
Text content.
Functions
Create a blob part with raw data and MIME type.
Create a part from a file path.
Parse a part from API payload.
Create an inline data part with base64 encoded data.
Create an inline data part with media resolution for Gemini 3.
Parameters
data: Base64 encoded datamime_type: MIME type of the dataresolution: Media resolution level (:low,:medium, or:high)
Examples
# High resolution for detailed image analysis
Part.inline_data_with_resolution(image_data, "image/jpeg", :high)
# Low resolution for faster processing
Part.inline_data_with_resolution(video_frame, "image/png", :low)
Create a text part.
Set media resolution on an existing part.
Parameters
part: Existing Part structresolution: Resolution level (:low,:medium, or:high)
Examples
part = Part.inline_data(image_data, "image/jpeg")
|> Part.with_resolution(:high)
Set thought signature on an existing part.
Used to maintain reasoning context across API calls in Gemini 3. The SDK handles this automatically in most cases.
Parameters
part: Existing Part structsignature: Thought signature string from a previous response