Codex.Turn.Result (Codex SDK v0.6.0)

Copy Markdown View Source

Result struct returned from turn execution.

Summary

Functions

Returns the decoded structured output when available.

Types

t()

@type t() :: %Codex.Turn.Result{
  attempts: non_neg_integer(),
  events: [Codex.Events.t()],
  final_response: Codex.Items.AgentMessage.t() | map() | nil,
  last_response_id: String.t() | nil,
  raw: map(),
  thread: Codex.Thread.t(),
  usage: map() | nil
}

Functions

json(arg1)

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

Returns the decoded structured output when available.

If the turn produced structured output and it was successfully decoded, the parsed map (or list) is returned. When the output is present but could not be decoded, an error tuple is returned. For natural language responses, :not_structured is returned.