# `Arcanum.Response.Normalizer`
[🔗](https://github.com/kakilangit/arcanum/blob/v0.1.0/lib/arcanum/response/normalizer.ex#L1)

Profile-driven post-processing of inference responses.

The adapter translates the wire format faithfully.
This module applies model-specific normalization based on the profile:

- Content fallback from thinking (reasoning models with empty content)
- Malformed tool-call filtering (models that emit incomplete tool calls)
- XML text tool-call extraction (models that emit tool calls as text)
- Streaming delta normalization

All model-specific behavior lives here — not in the adapter.

# `normalize`

```elixir
@spec normalize(Arcanum.Response.t(), Arcanum.ModelProfile.t()) ::
  Arcanum.Response.t()
```

Normalizes a complete (non-streaming) response based on the model profile.

# `normalize_delta`

```elixir
@spec normalize_delta(Arcanum.Response.t(), Arcanum.ModelProfile.t()) ::
  Arcanum.Response.t()
```

Normalizes a streaming delta based on the model profile.
Only applies content fallback (tool calls are extracted from the final merged response).

---

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