Codex.ToolOutput (Codex SDK v0.3.0)
View SourceStructured 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
@type t() :: Codex.ToolOutput.Text.t() | Codex.ToolOutput.Image.t() | Codex.ToolOutput.FileContent.t() | map() | list()
Functions
@spec file(keyword() | map()) :: Codex.ToolOutput.FileContent.t()
Convenience constructor for file content tool outputs.
@spec image(keyword() | map()) :: Codex.ToolOutput.Image.t()
Convenience constructor for image tool outputs.
Normalizes structured tool outputs into codex-compatible maps.
Lists are flattened and deduplicated to mirror the Python runner's history merging semantics.
@spec text(String.t()) :: Codex.ToolOutput.Text.t()
Convenience constructor for text tool outputs.