# `Jido.Chat.PostPayload`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/post_payload.ex#L1)

Typed normalized outbound payload used by thread/channel posting helpers.

# `t`

```elixir
@type t() :: %Jido.Chat.PostPayload{
  ast: nil | nil | any(),
  attachments: [
    %Jido.Chat.Attachment{
      data: term(),
      duration: term(),
      filename: term(),
      height: term(),
      kind: term(),
      media_type: term(),
      metadata: term(),
      path: term(),
      size_bytes: term(),
      url: term(),
      width: term()
    }
  ],
  card: nil | nil | any(),
  fallback_text: nil | nil | binary(),
  files: [
    %Jido.Chat.FileUpload{
      data: term(),
      duration: term(),
      filename: term(),
      height: term(),
      kind: term(),
      media_type: term(),
      metadata: term(),
      path: term(),
      size_bytes: term(),
      url: term(),
      width: term()
    }
  ],
  formatted: nil | nil | binary(),
  kind: :text | :markdown | :raw | :ast | :card | :stream,
  markdown: nil | nil | binary(),
  metadata: map(),
  raw: nil | nil | any(),
  stream: nil | nil | any(),
  text: nil | nil | binary()
}
```

# `display_text`

```elixir
@spec display_text(t()) :: String.t() | nil
```

Returns the best text fallback for the payload.

# `from_map`

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

Builds post payload from serialized data.

# `new`

```elixir
@spec new(map() | t()) :: t()
```

Creates a normalized post payload.

# `outbound_attachments`

```elixir
@spec outbound_attachments(t()) :: [Jido.Chat.Attachment.t()]
```

Returns outbound attachments including normalized file uploads.

# `schema`

Returns the Zoi schema for PostPayload.

# `stream`

```elixir
@spec stream() :: t()
```

Builds a stream payload marker.

# `stream`

```elixir
@spec stream(term(), keyword() | map()) :: t()
```

Builds a stream payload from chunk input.

# `text`

```elixir
@spec text(String.t(), keyword() | map()) :: t()
```

Builds a text payload.

# `to_map`

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

Serializes post payload into plain map with type marker.

# `upload_candidates`

```elixir
@spec upload_candidates(t()) :: [Jido.Chat.Attachment.t() | Jido.Chat.FileUpload.t()]
```

Returns upload candidates preserving canonical file inputs where present.

---

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