Gemini.Types.Response.EmbedContentBatch (GeminiEx v0.8.4)
View SourceComplete async batch embedding job status and results.
Returned by get_batch_status and get_batch_result operations. Represents the full state of an async batch embedding job including progress, timing, and results.
Fields
model: Model used for embeddingsname: Batch identifier (format: "batches/{batchId}")display_name: Human-readable batch nameinput_config: Input configuration (file or inline)output: Output containing results (when complete)create_time: When batch was createdend_time: When batch completed/failedupdate_time: Last update timestampbatch_stats: Progress and completion statisticsstate: Current batch statepriority: Processing priority
Examples
%EmbedContentBatch{
model: "models/gemini-embedding-001",
name: "batches/abc123def456",
display_name: "Knowledge Base Embeddings",
state: :processing,
batch_stats: %EmbedContentBatchStats{
request_count: 1000,
successful_request_count: 750,
failed_request_count: 50,
pending_request_count: 200
},
create_time: ~U[2025-10-14 17:00:00Z],
...
}
Summary
Functions
Creates a batch from API response data.
Checks if the batch is complete (either succeeded or failed).
Checks if the batch failed.
Checks if the batch is currently processing.
Calculates the progress percentage of the batch.
Types
@type t() :: %Gemini.Types.Response.EmbedContentBatch{ batch_stats: Gemini.Types.Response.EmbedContentBatchStats.t() | nil, create_time: DateTime.t() | nil, display_name: String.t(), end_time: DateTime.t() | nil, input_config: Gemini.Types.Request.InputEmbedContentConfig.t() | nil, model: String.t(), name: String.t(), output: Gemini.Types.Response.EmbedContentBatchOutput.t() | nil, priority: integer() | nil, state: Gemini.Types.Response.BatchState.t(), update_time: DateTime.t() | nil }
Functions
Creates a batch from API response data.
Parameters
data: Map containing the API response
Examples
EmbedContentBatch.from_api_response(%{
"model" => "models/gemini-embedding-001",
"name" => "batches/abc123",
"displayName" => "My Batch",
"state" => "PROCESSING",
...
})
Checks if the batch is complete (either succeeded or failed).
Examples
EmbedContentBatch.is_complete?(batch)
# => true
Checks if the batch failed.
Examples
EmbedContentBatch.is_failed?(batch)
# => false
Checks if the batch is currently processing.
Examples
EmbedContentBatch.is_processing?(batch)
# => true
Calculates the progress percentage of the batch.
Returns nil if batch stats are not available.
Examples
EmbedContentBatch.progress_percentage(batch)
# => 75.5