View Source LlmComposer.ProviderStreamChunk protocol (llm_composer v0.19.2)

Protocol that normalizes provider stream payloads into LlmComposer.StreamChunk structs.

Each provider must wrap its decoded JSON chunk into a provider-specific struct and implement this protocol so the central parser can treat every event uniformly.

Summary

Types

t()

All the types that implement this protocol.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

to_stream_chunk(raw, opts)

View Source
@spec to_stream_chunk(
  t(),
  keyword()
) :: {:ok, LlmComposer.StreamChunk.t()} | :skip | {:error, term()}