# `Gemini.Types.Request.BatchEmbedContentsRequest`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.15.0/lib/gemini/types/request/batch_embed_contents_request.ex#L1)

Request structure for batch embedding multiple content items.

Allows generating embeddings for multiple text inputs in a single API call,
which is more efficient than individual requests.

## Fields

- `requests`: List of individual embed content requests

## Examples

    %BatchEmbedContentsRequest{
      requests: [
        %EmbedContentRequest{
          model: "models/gemini-embedding-001",
          content: %Content{parts: [%Part{text: "First text"}]}
        },
        %EmbedContentRequest{
          model: "models/gemini-embedding-001",
          content: %Content{parts: [%Part{text: "Second text"}]}
        }
      ]
    }

# `t`

```elixir
@type t() :: %Gemini.Types.Request.BatchEmbedContentsRequest{
  requests: [Gemini.Types.Request.EmbedContentRequest.t()]
}
```

# `new`

```elixir
@spec new(
  [String.t()],
  keyword()
) :: t()
```

Creates a new batch embedding request from a list of texts.

Uses auth-aware embedding model selection:
- **Gemini API**: `gemini-embedding-001` with taskType parameter
- **Vertex AI**: `embeddinggemma` with prompt prefix formatting

## Parameters

- `texts`: List of text strings to embed
- `opts`: Optional keyword list of options to apply to all requests
  - `:model`: Model to use (default: auto-detected based on auth)
  - `:task_type`: Task type for optimized embeddings
  - `:output_dimensionality`: Dimension reduction

## Examples

    BatchEmbedContentsRequest.new([
      "What is AI?",
      "How does machine learning work?",
      "Explain neural networks"
    ])

    BatchEmbedContentsRequest.new(
      ["Doc 1", "Doc 2"],
      task_type: :retrieval_document,
      output_dimensionality: 256
    )

# `to_api_map`

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

Converts the batch request to API-compatible map format.

---

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