# Class LittleGhost::Embeddings::Request

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Embeddings/Request.html

Carries the validated inputs and controls for one embedding operation.

LittleGhost builds this value for LittleGhost.embed and passes it to the
selected provider. Provider implementations may receive calls concurrently.
They must observe `cancellation_token` and `deadline` while performing
external work.

## Inheritance

`LittleGhost::Embeddings::Request < Data`

## Attributes

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

Token that stops the provider operation when cancellation is requested.

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

Monotonic deadline for the provider operation, or `nil`.

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

Frozen input strings in caller order.

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

Frozen input budgets applied before LittleGhost retains the strings.

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

Frozen model settings chosen by trusted application code.

## Class methods

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

```ruby
new(inputs:, settings: {}, limits: {}, cancellation_token: Support::CancellationToken.new, deadline: nil) -> Request
```

Validates and freezes one String or a nonempty Array of Strings.

`settings` contains trusted model settings. `limits` may override the input
budgets:

`:max_inputs`
:   Number of input strings. Defaults to 128.

`:max_input_bytes`
:   Bytes allowed in one input. Defaults to 64 KiB.

`:max_total_bytes`
:   Bytes allowed across all inputs. Defaults to 1 MiB.

Invalid shapes raise ArgumentError; inputs outside these budgets raise
UnsupportedInputError.
