# `Gemini.Types.Response.EmbedContentBatch`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L1)

Complete 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 embeddings
- `name`: Batch identifier (format: "batches/{batchId}")
- `display_name`: Human-readable batch name
- `input_config`: Input configuration (file or inline)
- `output`: Output containing results (when complete)
- `create_time`: When batch was created
- `end_time`: When batch completed/failed
- `update_time`: Last update timestamp
- `batch_stats`: Progress and completion statistics
- `state`: Current batch state
- `priority`: 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],
      ...
    }

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L64)

```elixir
@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
}
```

# `complete?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L121)

```elixir
@spec complete?(t()) :: boolean()
```

Checks if the batch is complete (either succeeded or failed).

## Examples

    EmbedContentBatch.complete?(batch)
    # => true

# `failed?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L135)

```elixir
@spec failed?(t()) :: boolean()
```

Checks if the batch failed.

## Examples

    EmbedContentBatch.failed?(batch)
    # => false

# `from_api_response`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L96)

```elixir
@spec from_api_response(map()) :: t()
```

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",
      ...
    })

# `processing?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L147)

```elixir
@spec processing?(t()) :: boolean()
```

Checks if the batch is currently processing.

## Examples

    EmbedContentBatch.processing?(batch)
    # => true

# `progress_percentage`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/response/embed_content_batch.ex#L162)

```elixir
@spec progress_percentage(t()) :: float() | nil
```

Calculates the progress percentage of the batch.

Returns nil if batch stats are not available.

## Examples

    EmbedContentBatch.progress_percentage(batch)
    # => 75.5

---

*Consult [api-reference.md](api-reference.md) for complete listing*
