# `ALLM.StepResult`
[🔗](https://github.com/cykod/ALLM/blob/v0.5.0/lib/allm/step_result.ex#L1)

The result of a single chat step — Layer A serializable data.

Carries the updated `:thread`, the `:response` from the adapter, any
`:tool_results` appended during this step, and a `:done?` flag
indicating whether the chat loop should halt after this step.

The `:done?` field uses a `?`-suffixed atom key — legal Elixir, and
round-trips cleanly through `:erlang.term_to_binary/1` and tagged JSON
encoding via `ALLM.Serializer`.

# `t`

```elixir
@type t() :: %ALLM.StepResult{
  done?: boolean(),
  metadata: map(),
  response: ALLM.Response.t(),
  thread: ALLM.Thread.t(),
  tool_results: [ALLM.Message.t()]
}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Build a `%StepResult{}` from keyword opts.

Every field is optional but `:thread` and `:response` are usually set in
real output. Unknown keys raise `ArgumentError` via `struct!/2`.

## Examples

    iex> sr = ALLM.StepResult.new(done?: true)
    iex> sr.done?
    true
    iex> sr.tool_results
    []

---

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