# `Gemini.Types.Request.GenerateContentRequest`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/request/types_request_list_models_request.ex#L141)

Request structure for content generation.

Supports all generation parameters including safety settings,
system instructions, tools, and generation configuration.

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/request/types_request_list_models_request.ex#L154)

```elixir
@type t() :: %Gemini.Types.Request.GenerateContentRequest{
  contents: [Gemini.Types.Content.t()],
  generation_config: Gemini.Types.GenerationConfig.t() | nil,
  safety_settings: [Gemini.Types.SafetySetting.t()],
  system_instruction: Gemini.Types.Content.t() | nil,
  tool_config: map() | nil,
  tools: [map()]
}
```

# `new`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/request/types_request_list_models_request.ex#L184)

```elixir
@spec new(
  String.t() | [Gemini.Types.Content.t()],
  keyword()
) :: {:ok, t()} | {:error, String.t()}
```

Create a new GenerateContentRequest with validation.

## Parameters
- `contents` - List of Content structs or single string
- `opts` - Keyword list of options:
  - `:generation_config` - GenerationConfig struct
  - `:safety_settings` - List of SafetySetting structs
  - `:system_instruction` - System instruction as Content or string
  - `:tools` - List of tool definitions
  - `:tool_config` - Tool configuration

## Examples

    iex> GenerateContentRequest.new("Hello world")
    {:ok, %GenerateContentRequest{contents: [%Content{...}]}}

    iex> GenerateContentRequest.new([Content.text("Hello")])
    {:ok, %GenerateContentRequest{...}}

# `to_json_map`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/request/types_request_list_models_request.ex#L207)

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

Convert request to map suitable for JSON encoding.

Removes nil fields to create clean JSON payload.

---

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