# `Nous.CodeRuntime.Request`
[🔗](https://github.com/nyo16/nous/blob/v0.17.1/lib/nous/code_runtime/request.ex#L33)

What to run, what it may call, and who gets the answer.

Deliberately absent: **tuning knobs**. There is no timeout, no memory cap and no
instruction budget here. Budgets are provider configuration, validated when the
provider is configured, because a per-request budget is a per-request way for a
caller — and therefore, one refactor later, for a model — to ask for more rope.
A program cannot request a longer deadline for itself.

`owner` is the process that receives `{:code_run, ref, %Nous.CodeRuntime.Result{}}`.

# `t`

```elixir
@type t() :: %Nous.CodeRuntime.Request{
  bindings: [Nous.CodeRuntime.Binding.t()],
  owner: pid(),
  program: String.t()
}
```

# `new`

```elixir
@spec new(String.t(), [Nous.CodeRuntime.Binding.t()], pid()) ::
  {:ok, t()} | {:error, {:contract, String.t()}}
```

Build a request, validating the shape a provider is entitled to assume.

Returns `{:error, {:contract, message}}` rather than raising: a malformed
request is seam misuse by Nous itself, and the tool call that carried it should
fail cleanly rather than take down the run.

---

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