Behaviour for Codex transport implementations.
Transports handle the communication protocol between the SDK and the Codex runtime.
Summary
Callbacks
Interrupts a running turn.
Executes a single turn and returns the accumulated result.
Executes a turn and returns a stream of events.
Types
@type event_stream() :: Enumerable.t()
@type input() :: String.t()
@type thread() :: Codex.Thread.t()
@type turn_result() :: Codex.Turn.Result.t()
Callbacks
Interrupts a running turn.
Optional for transports that don't support it.
@callback run_turn(thread(), input(), turn_opts()) :: {:ok, turn_result()} | {:error, term()}
Executes a single turn and returns the accumulated result.
@callback run_turn_streamed(thread(), input(), turn_opts()) :: {:ok, event_stream()} | {:error, term()}
Executes a turn and returns a stream of events.