Codex.ToolOutput (Codex SDK v0.7.2)

Copy Markdown View Source

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.

Summary

Functions

Convenience constructor for file content tool outputs.

Convenience constructor for image tool outputs.

Normalizes structured tool outputs into codex-compatible maps.

Convenience constructor for text tool outputs.

Types

Functions

file(attrs)

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

Convenience constructor for file content tool outputs.

image(attrs)

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

Convenience constructor for image tool outputs.

normalize(list)

@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(text)

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

Convenience constructor for text tool outputs.