# `Pixir.Providers.Anthropic.Replay`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/providers/anthropic/replay.ex#L1)

Pure replay helpers for Anthropic extended-thinking content.

`replayable_block/2` accepts the string-keyed `data` from one canonical
`:reasoning` Event and returns the captured raw Anthropic `thinking` or
`redacted_thinking` block only when the event is Anthropic-dialect and was
captured by the same model. Blocks are never normalized or rewritten; signatures
and all other fields remain byte-identical to the Log payload.

`assistant_content/3` is the P6 fold integration seam. It accepts one assistant
turn's ordered History items (reasoning Events interleaved with tool_call Events
in arrival order) and a renderer function for non-reasoning/tool positions. This
module deliberately does not know how canonical `tool_call` Events become
Anthropic `tool_use` blocks; P6 supplies that renderer. The renderer is called
with each non-replayable item and may return a block, a list of blocks, or `nil`.

# `event_like`

```elixir
@type event_like() :: %{optional(:type) =&gt; atom(), optional(:data) =&gt; map()}
```

# `assistant_content`

```elixir
@spec assistant_content([event_like()], String.t(), (event_like() -&gt;
                                                 map() | [map()] | nil)) :: [
  map()
]
```

Build Anthropic assistant content, preserving reasoning/tool positions.

The renderer is required: non-reasoning items (tool_call events) must always
be transformed by the caller (the P6 fold) — a raw canonical event is never a
valid Anthropic content block. Envelope keys are atoms by contract, so only
atom-keyed `:reasoning` events are recognized.

# `replayable_block`

```elixir
@spec replayable_block(map(), String.t()) :: {:ok, map()} | :drop
```

Return a verbatim Anthropic thinking block when dialect and model match.

---

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