# Class LittleGhost::Providers::Gemini

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Providers/Gemini.html

Connects a Model to Google's Gemini generateContent API.

Requests send messages, Tool definitions, attachments, and model settings to
the configured Google endpoint. The adapter reads its API key from trusted
configuration, honors cancellation and deadlines, and emits LittleGhost
StreamEvents. HTTP and response-shape failures become ProviderError
subclasses. It uses the built-in HTTP client and does not require Google's
SDK.

## Inheritance

`LittleGhost::Providers::Gemini < LittleGhost::Providers::Base`

## Attributes

<a id="attribute-i-model"></a>
### `model` (R)

Provider-owned model identifier.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(api_key:, model:, base_url: DEFAULT_BASE_URL, open_timeout: 10, read_timeout: 120,
        max_response_bytes: Support::HTTPClient::DEFAULT_MAX_RESPONSE_BYTES, transport: nil, **)
```

Creates a Gemini generateContent client for `model`.

<a id="method-c-request_options"></a>
### `.request_options`

```ruby
.request_options()
```

Request policy supported by Gemini and Vertex AI HTTP clients.

## Instance methods

<a id="method-i-capabilities"></a>
### `#capabilities`

```ruby
#capabilities(metadata: {})
```

Reports Tool and structured-output support from model metadata.

<a id="method-i-stream"></a>
### `#stream`

```ruby
#stream(request)
```

Streams normalized events for `request`.
