Claudex.Stream.Event.ContentBlockDelta (Claudex v0.6.1)

Copy Markdown View Source

A piece of the content block at index. The delta is a tagged tuple you can match on directly:

%ContentBlockDelta{delta: {:text, chunk}} -> IO.write(chunk)

{:input_json, chunk} is a fragment of a tool call's arguments — the fragments are only valid JSON once concatenated, which Claudex.Stream.Accumulator does for you.

Summary

Types

delta()

@type delta() ::
  {:text, String.t()}
  | {:input_json, String.t()}
  | {:thinking, String.t()}
  | {:signature, String.t()}
  | {:citation, map()}
  | {:unknown, map()}

t()

@type t() :: %Claudex.Stream.Event.ContentBlockDelta{
  delta: delta(),
  index: non_neg_integer()
}