Codex.Items (Codex SDK v0.6.0)

Copy Markdown View Source

Typed representations of thread items emitted by the Codex runtime.

This module provides helpers to convert JSON-style maps (with string keys) into structs and back, keeping status fields normalised as atoms.

Summary

Functions

Parses a JSON-decoded map into a typed thread item struct.

Parses a raw response item (snake_case response output) into a typed struct.

Converts a typed item struct back into its JSON-serialisable map representation.

Types

Functions

parse!(map)

@spec parse!(map()) :: t()

Parses a JSON-decoded map into a typed thread item struct.

parse_raw_response_item(map)

@spec parse_raw_response_item(map()) :: {:ok, t()} | {:error, term()}

Parses a raw response item (snake_case response output) into a typed struct.

to_map(item)

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

Converts a typed item struct back into its JSON-serialisable map representation.