# Module LittleGhost::Content

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Content.html

Content gives messages a shared vocabulary for text, attachments, tool calls,
tool results, and model reasoning. The same blocks move between agents,
providers, tools, and sessions without leaking a provider's wire format.

    block = LittleGhost::Content::Text.new(text: "Hello")
    LittleGhost::Content.normalize("Hello") == block # => true

Every block serializes through
[Content.serialize](Content.md#method-i-serialize). Binary data uses
strict base64 encoding in the serialized form.

## Instance methods

<a id="method-i-from_hash"></a>
### `#from_hash`

```ruby
#from_hash(value)
```

Reconstructs a content block from its serialized hash.

<a id="method-i-normalize"></a>
### `#normalize`

```ruby
#normalize(value)
```

Accepts an existing block, a String, or a serialized Hash.

<a id="method-i-serialize"></a>
### `#serialize`

```ruby
#serialize(block)
```

Produces the JSON-safe representation of `block`.
