# `Raxol.AgentClientProtocol.Schema.ContentChunk`
[🔗](https://github.com/DROOdotFOO/raxol-agent/blob/raxol_agent_client_protocol-v0.1.0/packages/raxol_agent_client_protocol/lib/raxol/agent_client_protocol/schema/session_update.ex#L170)

A single streamed content block, used as the payload for the
`SessionUpdate` `user_message_chunk`/`agent_message_chunk`/
`agent_thought_chunk` variants.

Carries the pinned v1.19.0 oracle's optional `messageId` wire field
(`message_id` here -- groups chunks belonging to the same streamed
message; a change in `message_id` signals a new message has started).
f1729's `ACP.ContentChunk` has no such field; it is new to this port,
absent-safe on both decode (`nil` when omitted or non-string) and encode
(omitted, never emitted as `null`).

Ported from the MIT `f1729/agent_client_protocol` (c) 2025 f1729; see NOTICE.md.

# `t`

```elixir
@type t() :: %Raxol.AgentClientProtocol.Schema.ContentChunk{
  _meta: map(),
  content: Raxol.AgentClientProtocol.Schema.ContentBlock.t(),
  message_id: String.t() | nil
}
```

# `from_json`

```elixir
@spec from_json(term()) :: {:ok, t()} | {:error, term()}
```

Total: never raises. A missing/unparseable `content` is the only failure mode (required field); an absent/non-string `messageId` defaults to `nil`.

# `new`

```elixir
@spec new(Raxol.AgentClientProtocol.Schema.ContentBlock.t()) :: t()
```

# `new`

```elixir
@spec new(Raxol.AgentClientProtocol.Schema.ContentBlock.t(), String.t() | nil) :: t()
```

# `to_json`

```elixir
@spec to_json(t()) :: map()
```

---

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