# `Codex.ToolOutput`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/tool_output.ex#L1)

Structured tool output helpers that mirror the Responses input payload shapes.

Tool implementations may return these structs (or lists thereof). They will be converted
into codex-compatible maps before being forwarded back to the runner.

# `t`

```elixir
@type t() ::
  Codex.ToolOutput.Text.t()
  | Codex.ToolOutput.Image.t()
  | Codex.ToolOutput.FileContent.t()
  | map()
  | list()
```

# `file`

```elixir
@spec file(keyword() | map()) :: Codex.ToolOutput.FileContent.t()
```

Convenience constructor for file content tool outputs.

# `image`

```elixir
@spec image(keyword() | map()) :: Codex.ToolOutput.Image.t()
```

Convenience constructor for image tool outputs.

# `normalize`

```elixir
@spec normalize(t()) :: list() | map()
```

Normalizes structured tool outputs into codex-compatible maps.

Lists are flattened and deduplicated to mirror the Python runner's history
merging semantics.

# `text`

```elixir
@spec text(String.t()) :: Codex.ToolOutput.Text.t()
```

Convenience constructor for text tool outputs.

---

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